diff --git a/Parser/SpecFlowUnitTestConverter.cs b/Parser/SpecFlowUnitTestConverter.cs index ea6cf08ad..387406b0c 100644 --- a/Parser/SpecFlowUnitTestConverter.cs +++ b/Parser/SpecFlowUnitTestConverter.cs @@ -516,7 +516,7 @@ private CodeExpression GetMultilineTextArgExpression(string multiLineTextArgumen private void AddLinePragmaInitial(CodeTypeDeclaration testType, Feature feature) { - testType.Members.Add(new CodeSnippetTypeMember(string.Format("#line 1 \"{0}\"", feature.SourceFile))); + testType.Members.Add(new CodeSnippetTypeMember(string.Format("#line 1 \"{0}\"", Path.GetFileName(feature.SourceFile)))); testType.Members.Add(new CodeSnippetTypeMember("#line hidden")); } diff --git a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs index 7de45683c..a76b9c675 100644 --- a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs +++ b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs @@ -19,6 +19,9 @@ public partial class ScoreCalculationFeature private static TechTalk.SpecFlow.ITestRunner testRunner; +#line 1 "ScoreCalculation.feature" +#line hidden + [Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute()] public static void FeatureSetup(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext) { @@ -52,10 +55,15 @@ public virtual void ScenarioTearDown() public virtual void GutterGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Gutter game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("all of my balls are landing in the gutter"); - testRunner.Then("my total score should be 0"); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("a new bowling game"); +#line 8 + testRunner.When("all of my balls are landing in the gutter"); +#line 9 + testRunner.Then("my total score should be 0"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -65,12 +73,19 @@ public virtual void GutterGame() public virtual void BeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Beginners game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll 2 and 7"); - testRunner.And("I roll 3 and 4"); - testRunner.And("I roll 8 times 1 and 1"); - testRunner.Then("my total score should be 32"); +#line 11 +this.ScenarioSetup(scenarioInfo); +#line 12 + testRunner.Given("a new bowling game"); +#line 13 + testRunner.When("I roll 2 and 7"); +#line 14 + testRunner.And("I roll 3 and 4"); +#line 15 + testRunner.And("I roll 8 times 1 and 1"); +#line 16 + testRunner.Then("my total score should be 32"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -80,10 +95,15 @@ public virtual void BeginnersGame() public virtual void AnotherBeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Another beginners game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll the following series:\t2,7,3,4,1,1,5,1,1,1,1,1,1,1,1,1,1,1,5,1"); - testRunner.Then("my total score should be 40"); +#line 18 +this.ScenarioSetup(scenarioInfo); +#line 19 + testRunner.Given("a new bowling game"); +#line 20 + testRunner.When("I roll the following series:\t2,7,3,4,1,1,5,1,1,1,1,1,1,1,1,1,1,1,5,1"); +#line 21 + testRunner.Then("my total score should be 40"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -93,10 +113,15 @@ public virtual void AnotherBeginnersGame() public virtual void AllStrikes() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All Strikes", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("all of my rolls are strikes"); - testRunner.Then("my total score should be 300"); +#line 23 +this.ScenarioSetup(scenarioInfo); +#line 24 + testRunner.Given("a new bowling game"); +#line 25 + testRunner.When("all of my rolls are strikes"); +#line 26 + testRunner.Then("my total score should be 300"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -106,10 +131,15 @@ public virtual void AllStrikes() public virtual void OneSingleSpare() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("One single spare", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll the following series: 2,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); - testRunner.Then("my total score should be 29"); +#line 28 +this.ScenarioSetup(scenarioInfo); +#line 29 + testRunner.Given("a new bowling game"); +#line 30 + testRunner.When("I roll the following series: 2,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); +#line 31 + testRunner.Then("my total score should be 29"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -119,11 +149,17 @@ public virtual void OneSingleSpare() public virtual void AllSpares() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All spares", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll 10 times 1 and 9"); - testRunner.And("I roll 1"); - testRunner.Then("my total score should be 110"); +#line 33 +this.ScenarioSetup(scenarioInfo); +#line 34 + testRunner.Given("a new bowling game"); +#line 35 + testRunner.When("I roll 10 times 1 and 9"); +#line 36 + testRunner.And("I roll 1"); +#line 37 + testRunner.Then("my total score should be 110"); +#line hidden testRunner.CollectScenarioErrors(); } } diff --git a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs index 136351df9..4f15ac574 100644 --- a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs +++ b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs @@ -19,6 +19,9 @@ public partial class ScoreCalculationAlternativeFormsFeature private static TechTalk.SpecFlow.ITestRunner testRunner; +#line 1 "ScoreCalculationAlternatives.feature" +#line hidden + [Microsoft.VisualStudio.TestTools.UnitTesting.ClassInitializeAttribute()] public static void FeatureSetup(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext) { @@ -52,10 +55,15 @@ public virtual void ScenarioTearDown() public virtual void OneSingleSpare() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("One single spare", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll the following series:\t3,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); - testRunner.Then("my total score should be 29"); +#line 7 +this.ScenarioSetup(scenarioInfo); +#line 8 + testRunner.Given("a new bowling game"); +#line 9 + testRunner.When("I roll the following series:\t3,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); +#line 10 + testRunner.Then("my total score should be 29"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -65,11 +73,17 @@ public virtual void OneSingleSpare() public virtual void AllSpares() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All spares", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll 10 times 1 and 9"); - testRunner.And("I roll 1"); - testRunner.Then("my total score should be 110"); +#line 12 +this.ScenarioSetup(scenarioInfo); +#line 13 + testRunner.Given("a new bowling game"); +#line 14 + testRunner.When("I roll 10 times 1 and 9"); +#line 15 + testRunner.And("I roll 1"); +#line 16 + testRunner.Then("my total score should be 110"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -79,8 +93,11 @@ public virtual void AllSpares() public virtual void YetAnotherBeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Yet another beginners game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); +#line 18 +this.ScenarioSetup(scenarioInfo); +#line 19 + testRunner.Given("a new bowling game"); +#line hidden TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { "Pins"}); table1.AddRow(new string[] { @@ -123,8 +140,11 @@ public virtual void YetAnotherBeginnersGame() "1"}); table1.AddRow(new string[] { "1"}); - testRunner.When("I roll", ((string)(null)), table1); - testRunner.Then("my total score should be 43"); +#line 20 + testRunner.When("I roll", ((string)(null)), table1); +#line 42 + testRunner.Then("my total score should be 43"); +#line hidden testRunner.CollectScenarioErrors(); } } diff --git a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs index dddea821b..682927f65 100644 --- a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs +++ b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs @@ -20,6 +20,9 @@ public partial class ScoreCalculationFeature private static TechTalk.SpecFlow.ITestRunner testRunner; +#line 1 "ScoreCalculation.feature" +#line hidden + [NUnit.Framework.TestFixtureSetUpAttribute()] public virtual void FeatureSetup() { @@ -52,10 +55,15 @@ public virtual void ScenarioTearDown() public virtual void GutterGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Gutter game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("all of my balls are landing in the gutter"); - testRunner.Then("my total score should be 0"); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("a new bowling game"); +#line 8 + testRunner.When("all of my balls are landing in the gutter"); +#line 9 + testRunner.Then("my total score should be 0"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -64,12 +72,19 @@ public virtual void GutterGame() public virtual void BeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Beginners game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll 2 and 7"); - testRunner.And("I roll 3 and 4"); - testRunner.And("I roll 8 times 1 and 1"); - testRunner.Then("my total score should be 32"); +#line 11 +this.ScenarioSetup(scenarioInfo); +#line 12 + testRunner.Given("a new bowling game"); +#line 13 + testRunner.When("I roll 2 and 7"); +#line 14 + testRunner.And("I roll 3 and 4"); +#line 15 + testRunner.And("I roll 8 times 1 and 1"); +#line 16 + testRunner.Then("my total score should be 32"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -78,10 +93,15 @@ public virtual void BeginnersGame() public virtual void AnotherBeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Another beginners game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll the following series:\t2,7,3,4,1,1,5,1,1,1,1,1,1,1,1,1,1,1,5,1"); - testRunner.Then("my total score should be 40"); +#line 18 +this.ScenarioSetup(scenarioInfo); +#line 19 + testRunner.Given("a new bowling game"); +#line 20 + testRunner.When("I roll the following series:\t2,7,3,4,1,1,5,1,1,1,1,1,1,1,1,1,1,1,5,1"); +#line 21 + testRunner.Then("my total score should be 40"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -90,10 +110,15 @@ public virtual void AnotherBeginnersGame() public virtual void AllStrikes() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All Strikes", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("all of my rolls are strikes"); - testRunner.Then("my total score should be 300"); +#line 23 +this.ScenarioSetup(scenarioInfo); +#line 24 + testRunner.Given("a new bowling game"); +#line 25 + testRunner.When("all of my rolls are strikes"); +#line 26 + testRunner.Then("my total score should be 300"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -102,10 +127,15 @@ public virtual void AllStrikes() public virtual void OneSingleSpare() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("One single spare", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll the following series: 2,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); - testRunner.Then("my total score should be 29"); +#line 28 +this.ScenarioSetup(scenarioInfo); +#line 29 + testRunner.Given("a new bowling game"); +#line 30 + testRunner.When("I roll the following series: 2,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); +#line 31 + testRunner.Then("my total score should be 29"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -114,11 +144,17 @@ public virtual void OneSingleSpare() public virtual void AllSpares() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All spares", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll 10 times 1 and 9"); - testRunner.And("I roll 1"); - testRunner.Then("my total score should be 110"); +#line 33 +this.ScenarioSetup(scenarioInfo); +#line 34 + testRunner.Given("a new bowling game"); +#line 35 + testRunner.When("I roll 10 times 1 and 9"); +#line 36 + testRunner.And("I roll 1"); +#line 37 + testRunner.Then("my total score should be 110"); +#line hidden testRunner.CollectScenarioErrors(); } } diff --git a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs index ccc4024ab..6dcc025dc 100644 --- a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs +++ b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs @@ -20,6 +20,9 @@ public partial class ScoreCalculationAlternativeFormsFeature private static TechTalk.SpecFlow.ITestRunner testRunner; +#line 1 "ScoreCalculationAlternatives.feature" +#line hidden + [NUnit.Framework.TestFixtureSetUpAttribute()] public virtual void FeatureSetup() { @@ -52,10 +55,15 @@ public virtual void ScenarioTearDown() public virtual void OneSingleSpare() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("One single spare", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll the following series:\t3,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); - testRunner.Then("my total score should be 29"); +#line 7 +this.ScenarioSetup(scenarioInfo); +#line 8 + testRunner.Given("a new bowling game"); +#line 9 + testRunner.When("I roll the following series:\t3,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"); +#line 10 + testRunner.Then("my total score should be 29"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -64,11 +72,17 @@ public virtual void OneSingleSpare() public virtual void AllSpares() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All spares", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); - testRunner.When("I roll 10 times 1 and 9"); - testRunner.And("I roll 1"); - testRunner.Then("my total score should be 110"); +#line 12 +this.ScenarioSetup(scenarioInfo); +#line 13 + testRunner.Given("a new bowling game"); +#line 14 + testRunner.When("I roll 10 times 1 and 9"); +#line 15 + testRunner.And("I roll 1"); +#line 16 + testRunner.Then("my total score should be 110"); +#line hidden testRunner.CollectScenarioErrors(); } @@ -77,8 +91,11 @@ public virtual void AllSpares() public virtual void YetAnotherBeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Yet another beginners game", ((string[])(null))); - this.ScenarioSetup(scenarioInfo); - testRunner.Given("a new bowling game"); +#line 18 +this.ScenarioSetup(scenarioInfo); +#line 19 + testRunner.Given("a new bowling game"); +#line hidden TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { "Pins"}); table1.AddRow(new string[] { @@ -121,8 +138,11 @@ public virtual void YetAnotherBeginnersGame() "1"}); table1.AddRow(new string[] { "1"}); - testRunner.When("I roll", ((string)(null)), table1); - testRunner.Then("my total score should be 43"); +#line 20 + testRunner.When("I roll", ((string)(null)), table1); +#line 42 + testRunner.Then("my total score should be 43"); +#line hidden testRunner.CollectScenarioErrors(); } }