diff --git a/SpecNuts.ApprovalTestSuite/App.config b/SpecNuts.ApprovalTestSuite/App.config
deleted file mode 100644
index ed1a566..0000000
--- a/SpecNuts.ApprovalTestSuite/App.config
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SpecNuts.ApprovalTestSuite/App.config.transform b/SpecNuts.ApprovalTestSuite/App.config.transform
deleted file mode 100644
index fa8fb99..0000000
--- a/SpecNuts.ApprovalTestSuite/App.config.transform
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SpecNuts.ApprovalTestSuite/Properties/AssemblyInfo.cs b/SpecNuts.ApprovalTestSuite/Properties/AssemblyInfo.cs
index 4444e0a..19f995b 100644
--- a/SpecNuts.ApprovalTestSuite/Properties/AssemblyInfo.cs
+++ b/SpecNuts.ApprovalTestSuite/Properties/AssemblyInfo.cs
@@ -5,14 +5,6 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("SpecNuts.ApprovalTestSuite")]
-[assembly:
- AssemblyDescription(
- "A forked from SpecResults.ApprovalTestSuite project to provide the ability to generate json file in cucumber format.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("William Sia")]
-[assembly: AssemblyProduct("SpecNuts.ApprovalTestSuite")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -24,18 +16,4 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("a5289c34-47cc-4acf-80ef-d286a5779959")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
+[assembly: Guid("a5289c34-47cc-4acf-80ef-d286a5779959")]
\ No newline at end of file
diff --git a/SpecNuts.ApprovalTestSuite/SpecNuts.ApprovalTestSuite.csproj b/SpecNuts.ApprovalTestSuite/SpecNuts.ApprovalTestSuite.csproj
index 8b4cd29..6d23864 100644
--- a/SpecNuts.ApprovalTestSuite/SpecNuts.ApprovalTestSuite.csproj
+++ b/SpecNuts.ApprovalTestSuite/SpecNuts.ApprovalTestSuite.csproj
@@ -1,21 +1,34 @@
-
-
-
+
+
- Debug
+ SpecNuts.ApprovalTestSuite"
+
+ A forked from SpecResults.ApprovalTestSuite project to provide the ability to generate json file in cucumber format.
+ William Sia
+ SpecNuts.ApprovalTestSuite"
+ Copyright © 2016
+ 1.0.0.0
+ 1.0.0
+ 1.0.0.0
+
+
+
+ Debug
AnyCPU
{BBA703FA-94C4-437F-9961-2A321163988A}
Library
Properties
SpecResults.ApprovalTestSuite
SpecResults.ApprovalTestSuite
- v4.6
+ netcoreapp2.1
512
..\
true
+ false
-
+
+
true
full
false
@@ -56,79 +69,43 @@
MinimumRecommendedRules.ruleset
false
+
-
- ..\packages\ApprovalTests.3.0.5\lib\net40\ApprovalTests.dll
-
-
- ..\packages\ApprovalUtilities.3.0.5\lib\net35\ApprovalUtilities.dll
-
-
-
- ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll
-
-
- ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
-
-
-
-
-
-
-
-
- ..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll
-
-
- ..\packages\SpecFlow.2.3.1\lib\net45\TechTalk.SpecFlow.dll
-
+
+
+
+
+
+
+
+
-
- True
- True
- TestSuite.feature
-
-
-
-
+
+
+
-
-
-
-
- SpecFlowSingleFileGenerator
- TestSuite.feature.cs
-
-
- {c830c923-5398-4f28-99c2-1592ee5f4f7b}
- SpecNuts.Json
-
-
- {eaba391e-6b65-4e5c-8842-3d71a5f97b4f}
- SpecNuts
-
+
+
+
+
+
-
+
+ TestSuite.feature
+
+
+
+
+
+ PreserveNewest
+
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SpecNuts.ApprovalTestSuite/Steps.Definitions.cs b/SpecNuts.ApprovalTestSuite/Steps.Definitions.cs
index ee2c1b1..dfada6e 100644
--- a/SpecNuts.ApprovalTestSuite/Steps.Definitions.cs
+++ b/SpecNuts.ApprovalTestSuite/Steps.Definitions.cs
@@ -9,7 +9,13 @@ namespace SpecResults.ApprovalTestSuite
[Binding]
public partial class Steps : ReportingStepDefinitions
{
- [BeforeTestRun]
+ private readonly ScenarioContext _scenarioContext;
+ public Steps(ScenarioContext scenarioContext)
+ {
+ _scenarioContext = scenarioContext;
+ }
+
+ [BeforeTestRun]
public static void BeforeTestRun()
{
Reporters.FixedRunTime = DateTime.MinValue;
@@ -25,6 +31,8 @@ public void GivenAScenarioIsSpecified()
[When(@"the tests run")]
public async Task WhenTheTestsRun()
{
+ // Prevents CS1998
+ await Task.Run(() => { });
}
[Then(@"a report is generated")]
@@ -50,7 +58,7 @@ public void ThenReportIsGenerated(int p0)
[When(@"a step is not implemented")]
public void WhenAStepIsNotImplemented()
{
- ScenarioContext.Current.Pending();
+ _scenarioContext.Pending();
}
[When]
@@ -87,7 +95,7 @@ public void When_a_step_uses_method_name_underscore_style_with_a_table_param_and
[When(@"a child step was executed")]
public void WhenAChildStepWasExecuted()
{
- ReportStep(WhenTheTestsRun);
+ ReportStep(_scenarioContext, WhenTheTestsRun).Wait();
}
[Given(@"a ""(.*)"" scenario is specified with a multi-line argument")]
diff --git a/SpecNuts.ApprovalTestSuite/TestSuite.feature.cs b/SpecNuts.ApprovalTestSuite/TestSuite.feature.cs
index d9876ff..d6a6ffa 100644
--- a/SpecNuts.ApprovalTestSuite/TestSuite.feature.cs
+++ b/SpecNuts.ApprovalTestSuite/TestSuite.feature.cs
@@ -1,8 +1,8 @@
-// ------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
//
// This code was generated by SpecFlow (http://www.specflow.org/).
-// SpecFlow Version:2.1.0.0
-// SpecFlow Generator Version:2.0.0.0
+// SpecFlow Version:3.0.0.0
+// SpecFlow Generator Version:3.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -15,7 +15,7 @@ namespace SpecResults.ApprovalTestSuite
using TechTalk.SpecFlow;
- [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "2.1.0.0")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.0.0.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Test Suite")]
@@ -28,17 +28,17 @@ public partial class TestSuiteFeature
#line 1 "TestSuite.feature"
#line hidden
- [NUnit.Framework.TestFixtureSetUpAttribute()]
+ [NUnit.Framework.OneTimeSetUpAttribute()]
public virtual void FeatureSetup()
{
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
- TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Test Suite", "\tIn order to test my reporter plugin\r\n\tAs a developer\r\n\tI want to run a predefine" +
- "d test suite", ProgrammingLanguage.CSharp, new string[] {
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Test Suite", "\tIn order to test my reporter plugin\n\tAs a developer\n\tI want to run a predefined " +
+ "test suite", ProgrammingLanguage.CSharp, new string[] {
"Category:SomeFeatureCategory"});
testRunner.OnFeatureStart(featureInfo);
}
- [NUnit.Framework.TestFixtureTearDownAttribute()]
+ [NUnit.Framework.OneTimeTearDownAttribute()]
public virtual void FeatureTearDown()
{
testRunner.OnFeatureEnd();
@@ -56,9 +56,15 @@ public virtual void ScenarioTearDown()
testRunner.OnScenarioEnd();
}
- public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioInitialize(scenarioInfo);
+ testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs(NUnit.Framework.TestContext.CurrentContext);
+ }
+
+ public virtual void ScenarioStart()
{
- testRunner.OnScenarioStart(scenarioInfo);
+ testRunner.OnScenarioStart();
}
public virtual void ScenarioCleanup()
@@ -71,10 +77,11 @@ public virtual void ScenarioCleanup()
[NUnit.Framework.CategoryAttribute("SomeTag")]
public virtual void SingleScenario()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Single scenario", new string[] {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Single scenario", null, new string[] {
"SomeTag"});
#line 8
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 9
testRunner.Given("a scenario is specified", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 10
@@ -89,9 +96,10 @@ public virtual void SingleScenario()
[NUnit.Framework.DescriptionAttribute("Steps contain arguments")]
public virtual void StepsContainArguments()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Steps contain arguments", ((string[])(null)));
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Steps contain arguments", null, ((string[])(null)));
#line 13
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 14
testRunner.Given("a \"awesome\" scenario is specified", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 15
@@ -106,15 +114,16 @@ public virtual void StepsContainArguments()
[NUnit.Framework.DescriptionAttribute("Steps contain multi arguments")]
public virtual void StepsContainMultiArguments()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Steps contain multi arguments", ((string[])(null)));
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Steps contain multi arguments", null, ((string[])(null)));
#line 18
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line hidden
#line 19
- testRunner.Given("a \"awesome\" scenario is specified with a multi-line argument", "Here we go with mulitiple\r\nlines!", ((TechTalk.SpecFlow.Table)(null)), "Given ");
+ testRunner.Given("a \"awesome\" scenario is specified with a multi-line argument", "Here we go with mulitiple\nlines!", ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line hidden
#line 24
- testRunner.When("the tests with multiple line parameters", "like\r\nthis \r\none", ((TechTalk.SpecFlow.Table)(null)), "When ");
+ testRunner.When("the tests with multiple line parameters", "like\nthis \none", ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 30
testRunner.Then("\"1\" report is generated", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
@@ -125,9 +134,10 @@ public virtual void StepsContainMultiArguments()
[NUnit.Framework.DescriptionAttribute("Step is not implemented")]
public virtual void StepIsNotImplemented()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Step is not implemented", ((string[])(null)));
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Step is not implemented", null, ((string[])(null)));
#line 32
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 33
testRunner.Given("a scenario is specified", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 34
@@ -142,9 +152,10 @@ public virtual void StepIsNotImplemented()
[NUnit.Framework.DescriptionAttribute("Table param")]
public virtual void TableParam()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Table param", ((string[])(null)));
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Table param", null, ((string[])(null)));
#line 37
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 38
testRunner.Given("a scenario is specified", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line hidden
@@ -172,9 +183,10 @@ public virtual void TableParam()
[NUnit.Framework.DescriptionAttribute("Step uses method-name undescores style")]
public virtual void StepUsesMethod_NameUndescoresStyle()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Step uses method-name undescores style", ((string[])(null)));
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Step uses method-name undescores style", null, ((string[])(null)));
#line 46
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 47
testRunner.Given("a scenario is specified", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 48
@@ -191,9 +203,10 @@ public virtual void StepUsesMethod_NameUndescoresStyle()
[NUnit.Framework.DescriptionAttribute("Step uses method-name undescores style with table param")]
public virtual void StepUsesMethod_NameUndescoresStyleWithTableParam()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Step uses method-name undescores style with table param", ((string[])(null)));
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Step uses method-name undescores style with table param", null, ((string[])(null)));
#line 52
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 53
testRunner.Given("a scenario is specified", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line hidden
@@ -221,9 +234,10 @@ public virtual void StepUsesMethod_NameUndescoresStyleWithTableParam()
[NUnit.Framework.DescriptionAttribute("Nested step")]
public virtual void NestedStep()
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Nested step", ((string[])(null)));
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Nested step", null, ((string[])(null)));
#line 61
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 62
testRunner.Given("a scenario is specified", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 63
@@ -236,13 +250,14 @@ public virtual void NestedStep()
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("eating")]
- [NUnit.Framework.TestCaseAttribute("12", "5", "7", new string[0])]
- [NUnit.Framework.TestCaseAttribute("20", "5", "15", new string[0])]
+ [NUnit.Framework.TestCaseAttribute("12", "5", "7", null)]
+ [NUnit.Framework.TestCaseAttribute("20", "5", "15", null)]
public virtual void Eating(string start, string eat, string left, string[] exampleTags)
{
- TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("eating", exampleTags);
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("eating", null, exampleTags);
#line 66
-this.ScenarioSetup(scenarioInfo);
+this.ScenarioInitialize(scenarioInfo);
+ this.ScenarioStart();
#line 67
testRunner.Given(string.Format("there are {0} cucumbers", start), ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 68
diff --git a/SpecNuts.ApprovalTestSuite/packages.config b/SpecNuts.ApprovalTestSuite/packages.config
deleted file mode 100644
index ea40ead..0000000
--- a/SpecNuts.ApprovalTestSuite/packages.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SpecNuts.ApprovalTestSuite/specflow.json b/SpecNuts.ApprovalTestSuite/specflow.json
new file mode 100644
index 0000000..ff05030
--- /dev/null
+++ b/SpecNuts.ApprovalTestSuite/specflow.json
@@ -0,0 +1,6 @@
+{
+ "stepAssemblies":
+ [
+ { "assembly": "SpecNuts" }
+ ]
+}
\ No newline at end of file
diff --git a/SpecNuts.Json/App.config b/SpecNuts.Json/App.config
deleted file mode 100644
index 333c1fa..0000000
--- a/SpecNuts.Json/App.config
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SpecNuts.Json/Properties/AssemblyInfo.cs b/SpecNuts.Json/Properties/AssemblyInfo.cs
index 70a9272..788947d 100644
--- a/SpecNuts.Json/Properties/AssemblyInfo.cs
+++ b/SpecNuts.Json/Properties/AssemblyInfo.cs
@@ -5,12 +5,6 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("SpecNuts.Json")]
-[assembly: AssemblyDescription("A forked from SpecResults.Json project to provide the ability to generate json file in cucumber format.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("William Sia")]
-[assembly: AssemblyProduct("SpecNuts.Json")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -22,18 +16,4 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("4ebe0eb3-a53b-4bda-91aa-187a31592ff7")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
\ No newline at end of file
+[assembly: Guid("4ebe0eb3-a53b-4bda-91aa-187a31592ff7")]
\ No newline at end of file
diff --git a/SpecNuts.Json/SpecNuts.Json.csproj b/SpecNuts.Json/SpecNuts.Json.csproj
index 0207946..77626b4 100644
--- a/SpecNuts.Json/SpecNuts.Json.csproj
+++ b/SpecNuts.Json/SpecNuts.Json.csproj
@@ -1,17 +1,25 @@
-
-
-
+
+
+ SpecNuts.Json
+
+ A forked from SpecResults.Json project to provide the ability to generate json file in cucumber format.
+ William Sia
+ SpecNuts.Json
+ Copyright © 2016
+ 1.1.0.0
+ 1.1.0
+ 1.1.0.0
+
+
Debug
AnyCPU
- {C830C923-5398-4F28-99C2-1592EE5F4F7B}
Library
Properties
SpecNuts.Json
SpecNuts.Json
- v4.6
+ netstandard2.0
512
-
..\..\
true
@@ -56,52 +64,11 @@
false
-
-
-
-
-
-
-
-
- ..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll
-
-
- ..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll
-
-
- ..\packages\SpecFlow.2.3.1\lib\net45\TechTalk.SpecFlow.dll
-
-
-
-
-
-
-
+
-
-
-
+
-
-
- {eaba391e-6b65-4e5c-8842-3d71a5f97b4f}
- SpecNuts
-
-
-
+
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SpecNuts.Json/packages.config b/SpecNuts.Json/packages.config
deleted file mode 100644
index c6a5434..0000000
--- a/SpecNuts.Json/packages.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SpecNuts.UnitTests/Properties/AssemblyInfo.cs b/SpecNuts.UnitTests/Properties/AssemblyInfo.cs
index 7a2dbfc..11952a5 100644
--- a/SpecNuts.UnitTests/Properties/AssemblyInfo.cs
+++ b/SpecNuts.UnitTests/Properties/AssemblyInfo.cs
@@ -5,12 +5,6 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("SpecResults.UnitTests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SpecResults.UnitTests")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -22,18 +16,4 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("fdba9fc2-64df-467a-a836-654e5bc76d96")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
+[assembly: Guid("fdba9fc2-64df-467a-a836-654e5bc76d96")]
\ No newline at end of file
diff --git a/SpecNuts.UnitTests/SpecNuts.UnitTests.csproj b/SpecNuts.UnitTests/SpecNuts.UnitTests.csproj
index 2d00a0f..3e1e06e 100644
--- a/SpecNuts.UnitTests/SpecNuts.UnitTests.csproj
+++ b/SpecNuts.UnitTests/SpecNuts.UnitTests.csproj
@@ -1,20 +1,31 @@
-
-
-
+
+
+ SpecResults.UnitTests
+
+
+
+ SpecResults.UnitTests
+ Copyright © 2014
+ 1.0.0.0
+ 1.0.0
+ 1.0.0.0
+
+
+
Debug
AnyCPU
- {95C18142-2C66-4CA9-8F63-A9B7F65A1820}
Library
Properties
SpecResults.UnitTests
SpecResults.UnitTests
- v4.6
+ netcoreapp2.1
512
..\
true
-
+ false
+
true
full
@@ -32,41 +43,19 @@
prompt
4
+
-
- ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {eaba391e-6b65-4e5c-8842-3d71a5f97b4f}
- SpecNuts
-
+
+
+
+
-
+
-
+
-
+
-
\ No newline at end of file
diff --git a/SpecNuts.UnitTests/packages.config b/SpecNuts.UnitTests/packages.config
deleted file mode 100644
index ad37a52..0000000
--- a/SpecNuts.UnitTests/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/SpecNuts/App.config b/SpecNuts/App.config
deleted file mode 100644
index c97e16b..0000000
--- a/SpecNuts/App.config
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SpecNuts/App.config.transform b/SpecNuts/App.config.transform
deleted file mode 100644
index e3abde9..0000000
--- a/SpecNuts/App.config.transform
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SpecNuts/Extensions.cs b/SpecNuts/Extensions.cs
index 430cddd..5bd1cc4 100644
--- a/SpecNuts/Extensions.cs
+++ b/SpecNuts/Extensions.cs
@@ -40,11 +40,26 @@ public static TestResult GetResult(this IEnumerable results)
return TestResult.passed;
}
- internal static IEnumerable GetPendingSteps(this ScenarioContext scenarioContenxt)
+ internal static TestResult ToTestResult(this ScenarioExecutionStatus executionStatus)
+ {
+ switch (executionStatus)
+ {
+ case ScenarioExecutionStatus.OK:
+ return TestResult.passed;
+ case ScenarioExecutionStatus.StepDefinitionPending:
+ return TestResult.pending;
+ case ScenarioExecutionStatus.TestError:
+ return TestResult.failed;
+ default:
+ return TestResult.undefined;
+ }
+ }
+
+ internal static IEnumerable GetPendingSteps(this ScenarioContext scenarioContenxt)
{
return typeof (ScenarioContext)
.GetProperty("PendingSteps", BindingFlags.NonPublic | BindingFlags.Instance)
- .GetValue(ScenarioContext.Current, null) as IEnumerable
+ .GetValue(scenarioContenxt, null) as IEnumerable
?? new string[0];
}
diff --git a/SpecNuts/Model/Feature.cs b/SpecNuts/Model/Feature.cs
index 1c567ec..59687c5 100644
--- a/SpecNuts/Model/Feature.cs
+++ b/SpecNuts/Model/Feature.cs
@@ -8,7 +8,7 @@ public class Feature : TaggedReportItem
private static readonly string DefaultUri = "/uri/placeholder";
- public string Description
+ public new string Description
{
get { return _description; }
set { _description = string.IsNullOrEmpty(value) ? value : value.Replace("\r", ""); }
diff --git a/SpecNuts/Properties/AssemblyInfo.cs b/SpecNuts/Properties/AssemblyInfo.cs
index ed3f4bf..9b04460 100644
--- a/SpecNuts/Properties/AssemblyInfo.cs
+++ b/SpecNuts/Properties/AssemblyInfo.cs
@@ -1,15 +1,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
-[assembly: AssemblyTitle("SpecNuts")]
-[assembly: AssemblyDescription("A forked from SpecResults project to provide the ability to generate test result in cucumber format.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("William Sia")]
-[assembly: AssemblyProduct("SpecNuts")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
-[assembly: Guid("301e04c6-bc1b-4da4-83f0-5fdf76fea8bb")]
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
\ No newline at end of file
+[assembly: Guid("301e04c6-bc1b-4da4-83f0-5fdf76fea8bb")]
\ No newline at end of file
diff --git a/SpecNuts/Reporters.SpecFlowHooks.cs b/SpecNuts/Reporters.SpecFlowHooks.cs
index a796446..5dedcb1 100644
--- a/SpecNuts/Reporters.SpecFlowHooks.cs
+++ b/SpecNuts/Reporters.SpecFlowHooks.cs
@@ -2,6 +2,8 @@
using System.Linq;
using SpecNuts.Model;
using TechTalk.SpecFlow;
+using TechTalk.SpecFlow.Bindings;
+using TechTalk.SpecFlow.Bindings.Reflection;
namespace SpecNuts
{
@@ -63,8 +65,32 @@ internal static void AfterTestRun()
}
}
- [BeforeFeature]
- internal static void BeforeFeature()
+ [AfterStep]
+ internal static void AfterStep(ScenarioContext scenarioContext)
+ {
+ var endtime = CurrentRunTime;
+ var result = scenarioContext.ScenarioExecutionStatus.ToTestResult();
+ var error = scenarioContext.TestError?.ToExceptionInfo().Message;
+ error = (error == null && result == TestResult.pending) ? new PendingStepException().ToExceptionInfo().Message : string.Empty;
+
+ foreach (var reporter in reporters.ToArray())
+ {
+ var step = reporter.CurrentStep;
+ step.EndTime = CurrentRunTime;
+ step.Result = new StepResult
+ {
+ Duration = (long)((endtime - reporter.CurrentStep.StartTime).TotalMilliseconds * 1000000),
+ Status = result,
+ Error = error
+ };
+ OnFinishedStep(reporter);
+ reporter.CurrentStep = null;
+ }
+ }
+
+
+ [BeforeFeature]
+ internal static void BeforeFeature(FeatureContext featureContext)
{
var starttime = CurrentRunTime;
@@ -89,14 +115,14 @@ internal static void BeforeFeature()
foreach (var reporter in reporters)
{
- var featureId = FeatureContext.Current.FeatureInfo.Title.Replace(" ", "-").ToLower();
+ var featureId = featureContext.FeatureInfo.Title.Replace(" ", "-").ToLower();
var feature = new Feature
{
- Tags = FeatureContext.Current.FeatureInfo.Tags.Select(tag => new Tag() { Name = "@" + tag }).ToList(),
+ Tags = featureContext.FeatureInfo.Tags.Select(tag => new Tag() { Name = "@" + tag }).ToList(),
Elements = new List(),
StartTime = starttime,
- Name = FeatureContext.Current.FeatureInfo.Title,
- Description = FeatureContext.Current.FeatureInfo.Description,
+ Name = featureContext.FeatureInfo.Title,
+ Description = featureContext.FeatureInfo.Description,
Id = featureId,
Uri = $"/{featureId}"
};
@@ -109,7 +135,7 @@ internal static void BeforeFeature()
}
[BeforeScenario]
- internal static void BeforeScenario()
+ internal static void BeforeScenario(ScenarioContext scenarioContext)
{
var starttime = CurrentRunTime;
@@ -117,11 +143,11 @@ internal static void BeforeScenario()
{
var scenario = new Scenario
{
- Tags = ScenarioContext.Current.ScenarioInfo.Tags.Select(tag => new Tag() { Name = "@" + tag }).ToList(),
+ Tags = scenarioContext.ScenarioInfo.Tags.Select(tag => new Tag() { Name = "@" + tag }).ToList(),
StartTime = starttime,
- Name = ScenarioContext.Current.ScenarioInfo.Title,
+ Name = scenarioContext.ScenarioInfo.Title,
Steps = new List(),
- Description = ScenarioContext.Current.ScenarioInfo.Title
+ Description = scenarioContext.ScenarioInfo.Title
};
reporter.CurrentFeature.Elements.Add(scenario);
@@ -136,5 +162,25 @@ internal static void BeforeTestRun()
{
_testrunIsFirstFeature = true;
}
- }
+
+ [BeforeStep]
+ internal static void BeforeStep(ScenarioContext scenarioContext)
+ {
+ var starttime = CurrentRunTime;
+ var stepInfo = ScenarioStepContext.Current.StepInfo;
+ var binding = stepInfo.BindingMatch.StepBinding as StepDefinitionBinding;
+ var method = binding?.Method as RuntimeBindingMethod;
+
+ foreach (var reporter in reporters)
+ {
+ var step = CreateStep(scenarioContext, starttime);
+
+ reporter.CurrentScenario.Steps.Add(step);
+ reporter.CurrentStep = step;
+
+ OnStartedStep(reporter);
+ }
+ }
+
+ }
}
\ No newline at end of file
diff --git a/SpecNuts/Reporters.cs b/SpecNuts/Reporters.cs
index c68fa95..2f5bd79 100644
--- a/SpecNuts/Reporters.cs
+++ b/SpecNuts/Reporters.cs
@@ -30,21 +30,30 @@ internal static DateTime CurrentRunTime
}
return DateTime.Now;
}
- }
-
- internal static Step CreateStep(DateTime starttime, MethodBase method, params object[] args)
+ }
+
+ private static void addStepRows(ref Step step, Table table)
+ {
+ step.Rows = new List { new Row() { Cells = table.Header.ToList() } };
+ foreach (var tableRow in table.Rows)
+ {
+ step.Rows.Add(new Row() { Cells = tableRow.Select(x => x.Value).ToList() });
+ }
+ }
+
+ internal static Step CreateStep(ScenarioContext scenarioContext, DateTime starttime, MethodBase method = null, params object[] args)
{
- var methodName = method.Name;
+ var stepInfo = ScenarioStepContext.Current.StepInfo;
- var step = new Step
+ var step = new Step
{
- Name = ScenarioStepContext.Current.StepInfo.Text,
+ Name = stepInfo.Text,
StartTime = starttime,
- Keyword = ScenarioContext.Current.CurrentScenarioBlock + " ",
- Id = ScenarioStepContext.Current.StepInfo.Text.Replace(" ", "-").ToLower()
+ Keyword = scenarioContext.CurrentScenarioBlock + " ",
+ Id = stepInfo.Text.Replace(" ", "-").ToLower()
};
- var attr = method.GetCustomAttributes(true).OfType().FirstOrDefault();
+ var attr = method?.GetCustomAttributes(true).OfType().FirstOrDefault();
if (attr != null)
{
// Handle regex style
@@ -58,16 +67,7 @@ internal static Step CreateStep(DateTime starttime, MethodBase method, params ob
var table = arg as Table;
if (table != null)
{
-
- step.Rows = new List { new Row() { Cells = table.Header.ToList() } };
-
- foreach (var tableRow in table.Rows)
- {
- step.Rows.Add(new Row()
- {
- Cells = tableRow.Select(x => x.Value).ToList()
- });
- }
+ addStepRows(ref step, table);
}
else
{
@@ -86,6 +86,7 @@ internal static Step CreateStep(DateTime starttime, MethodBase method, params ob
}
else
{
+ var methodName = method.Name;
if (methodName.Contains('_'))
{
// underscore style
@@ -99,15 +100,7 @@ internal static Step CreateStep(DateTime starttime, MethodBase method, params ob
var table = arg as Table;
if (table != null)
{
- step.Rows = new List { new Row() { Cells = table.Header.ToList() } };
-
- foreach (var tableRow in table.Rows)
- {
- step.Rows.Add(new Row()
- {
- Cells = tableRow.Select(x => x.Value).ToList()
- });
- }
+ addStepRows(ref step, table);
}
else
{
@@ -131,18 +124,25 @@ internal static Step CreateStep(DateTime starttime, MethodBase method, params ob
}
}
}
-
- step.Name = ScenarioStepContext.Current.StepInfo.Text;
-
- return step;
+ else
+ {
+ var table = stepInfo.Table;
+ if(table != null)
+ {
+ addStepRows(ref step, table);
+ }
+ step.MultiLineParameter = stepInfo.MultilineText;
+ }
+
+ return step;
}
- internal static async Task ExecuteStep(Func stepFunc, params object[] args)
+ internal static async Task ExecuteStep(ScenarioContext scenarioContext,Func stepFunc, params object[] args)
{
- await ExecuteStep(stepFunc, null, args);
+ await ExecuteStep(scenarioContext, stepFunc, null, args);
}
- internal static async Task ExecuteStep(Func stepFunc, MethodBase methodBase, params object[] args)
+ internal static async Task ExecuteStep(ScenarioContext scenarioContext, Func stepFunc, MethodBase methodBase, params object[] args)
{
methodBase = methodBase ?? stepFunc.Method;
@@ -153,7 +153,7 @@ internal static async Task ExecuteStep(Func stepFunc, MethodBase methodBas
{
currentSteps.Add(reporter, reporter.CurrentStep);
- var step = CreateStep(starttime, methodBase, args);
+ var step = CreateStep(scenarioContext, starttime, methodBase, args);
var stepContainer = reporter.CurrentScenario;
stepContainer.Steps.Add(step);
diff --git a/SpecNuts/ReportingAspect/ReportingAttribute.cs b/SpecNuts/ReportingAspect/ReportingAttribute.cs
deleted file mode 100644
index f2f0abb..0000000
--- a/SpecNuts/ReportingAspect/ReportingAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System.Runtime.Remoting.Activation;
-using System.Runtime.Remoting.Contexts;
-
-namespace SpecNuts.ReportingAspect
-{
- internal class ReportingAttribute : ContextAttribute
- {
- public ReportingAttribute()
- : base("Reporting")
- {
- }
-
- public override void GetPropertiesForNewContext(IConstructionCallMessage ccm)
- {
- ccm.ContextProperties.Add(new ReportingProperty());
- }
-
- public override bool IsContextOK(Context ctx, IConstructionCallMessage ctorMsg)
- {
- var p = ctx.GetProperty("Reporting") as ReportingProperty;
- if (p == null)
- {
- return false;
- }
- return true;
- }
-
- public override bool IsNewContextOK(Context newCtx)
- {
- var p = newCtx.GetProperty("Reporting") as ReportingProperty;
- if (p == null)
- {
- return false;
- }
- return true;
- }
- }
-}
\ No newline at end of file
diff --git a/SpecNuts/ReportingAspect/ReportingMessageSink.cs b/SpecNuts/ReportingAspect/ReportingMessageSink.cs
deleted file mode 100644
index 70584a1..0000000
--- a/SpecNuts/ReportingAspect/ReportingMessageSink.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System.Runtime.Remoting.Messaging;
-using System.Threading.Tasks;
-
-namespace SpecNuts.ReportingAspect
-{
- internal class ReportingMessageSink : IMessageSink
- {
- public ReportingMessageSink(IMessageSink next)
- {
- NextSink = next;
- }
-
- public IMessageSink NextSink { get; private set; }
-
- public IMessageCtrl AsyncProcessMessage(IMessage msg, IMessageSink replySink)
- {
- var rtnMsgCtrl = NextSink.AsyncProcessMessage(msg, replySink);
- return rtnMsgCtrl;
- }
-
- public IMessage SyncProcessMessage(IMessage msg)
- {
- var methodMessage = new MethodCallMessageWrapper((IMethodCallMessage)msg);
-
- // Avoid reporting proxy method calls for fields injected via the constructor
- // in the step definition classes. This caused some steps to pe reported twice.
- if (methodMessage.MethodName == "FieldGetter")
- {
- return NextSink.SyncProcessMessage(msg);
- }
-
- IMethodReturnMessage mrm = null;
- var task = Reporters.ExecuteStep(
- () =>
- {
- mrm = (IMethodReturnMessage)NextSink.SyncProcessMessage(msg);
-
- if (mrm.Exception != null)
- {
- return Task.FromException(mrm.Exception);
- }
-
- return (mrm.ReturnValue as Task) ?? Task.CompletedTask;
- },
- methodMessage.MethodBase,
- methodMessage.Args
- );
-
- if (task.IsCompleted)
- {
- return mrm;
- }
- else
- {
- return new ReturnMessage(task, null, 0, mrm.LogicalCallContext, methodMessage);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/SpecNuts/ReportingAspect/ReportingProperty.cs b/SpecNuts/ReportingAspect/ReportingProperty.cs
deleted file mode 100644
index f9ace7d..0000000
--- a/SpecNuts/ReportingAspect/ReportingProperty.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-using System.Runtime.Remoting.Contexts;
-using System.Runtime.Remoting.Messaging;
-
-namespace SpecNuts.ReportingAspect
-{
- internal class ReportingProperty : IContextProperty, IContributeObjectSink
- {
- public void Freeze(Context newContext)
- {
- }
-
- public bool IsNewContextOK(Context newCtx)
- {
- var p = newCtx.GetProperty("Reporting") as ReportingProperty;
- if (p == null)
- {
- return false;
- }
- return true;
- }
-
- public string Name
- {
- get { return "Reporting"; }
- }
-
- public IMessageSink GetObjectSink(MarshalByRefObject o, IMessageSink next)
- {
- return new ReportingMessageSink(next);
- }
- }
-}
\ No newline at end of file
diff --git a/SpecNuts/ReportingStepDefinitions.cs b/SpecNuts/ReportingStepDefinitions.cs
index ea36d4b..9f925ad 100644
--- a/SpecNuts/ReportingStepDefinitions.cs
+++ b/SpecNuts/ReportingStepDefinitions.cs
@@ -1,15 +1,14 @@
using System;
using System.Threading.Tasks;
-using SpecNuts.ReportingAspect;
+using TechTalk.SpecFlow;
namespace SpecNuts
{
- [Reporting]
public abstract class ReportingStepDefinitions : ContextBoundObject
{
- public async Task ReportStep(Func stepFunc, params object[] args)
+ public async Task ReportStep(ScenarioContext scenarioContext, Func stepFunc, params object[] args)
{
- await Reporters.ExecuteStep(stepFunc, args);
+ await Reporters.ExecuteStep(scenarioContext, stepFunc, args);
}
}
}
\ No newline at end of file
diff --git a/SpecNuts/SpecNuts.csproj b/SpecNuts/SpecNuts.csproj
index fbae2d5..d917280 100644
--- a/SpecNuts/SpecNuts.csproj
+++ b/SpecNuts/SpecNuts.csproj
@@ -1,20 +1,29 @@
-
-
-
+
+
+ SpecNuts
+
+ A forked from SpecResults project to provide the ability to generate test result in cucumber format.
+ William Sia
+ SpecNuts
+ Copyright © 2016
+ 1.1.0.0
+ 1.1.0
+ 1.1.0.0
+
+
Debug
AnyCPU
- {EABA391E-6B65-4E5C-8842-3D71A5F97B4F}
Library
Properties
SpecNuts
SpecNuts
- v4.6
+ netstandard2.0
512
-
..\
true
+
true
full
@@ -24,6 +33,7 @@
prompt
4
false
+ false
pdbonly
@@ -33,6 +43,7 @@
prompt
4
false
+ false
bin\Build Nuget Packages\
@@ -44,6 +55,7 @@
MinimumRecommendedRules.ruleset
bin\Build Nuget Packages\SpecNuts.xml
false
+ false
bin\NuGet\
@@ -54,71 +66,23 @@
prompt
MinimumRecommendedRules.ruleset
false
+ false
-
- ..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll
-
-
-
-
-
-
-
-
-
- ..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll
-
-
- ..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll
-
-
- ..\packages\SpecFlow.2.3.1\lib\net45\TechTalk.SpecFlow.dll
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
+
-
-
\ No newline at end of file
diff --git a/SpecNuts/packages.config b/SpecNuts/packages.config
deleted file mode 100644
index 5c7712a..0000000
--- a/SpecNuts/packages.config
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
index 7221a42..ceedbbf 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,3 +1,6 @@
+image: Visual Studio 2017
+before_build:
+ - cmd: dotnet restore
deploy:
provider: NuGet
api_key: