From 1e44158b250dbb3e381fa4756fba57aee93a072b Mon Sep 17 00:00:00 2001 From: Gaspar Nagy Date: Wed, 25 Nov 2009 20:15:13 +0100 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFsmall=20fixes,=20prepare=20for=20relea?= =?UTF-8?q?se=201.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Generator/SpecFlowGenerator.cs | 2 +- Installer/SpecFlowSetup/SpecFlowSetup.vdproj | 162 ++++++++++++------ Parser/SpecFlowGenerator.cs | 85 --------- Parser/TechTalk.SpecFlow.Parser.csproj | 4 +- .../ScoreCalculation.feature.cs | 20 +-- .../ScoreCalculationAlternatives.feature.cs | 20 +-- .../ScoreCalculation.feature.cs | 101 +++++++---- .../ScoreCalculationAlternatives.feature.cs | 59 ++++--- Tools/TechTalk.SpecFlow.Tools.csproj | 8 +- VersionInfo.cs | 4 +- changelog.txt | 3 +- 11 files changed, 237 insertions(+), 231 deletions(-) delete mode 100644 Parser/SpecFlowGenerator.cs diff --git a/Generator/SpecFlowGenerator.cs b/Generator/SpecFlowGenerator.cs index 302d517fd..39c6b82af 100644 --- a/Generator/SpecFlowGenerator.cs +++ b/Generator/SpecFlowGenerator.cs @@ -60,7 +60,7 @@ public CodeNamespace GenerateTestFileCode(SpecFlowFeatureFile featureFile, TextR IUnitTestGeneratorProvider generatorProvider = ConfigurationServices.CreateInstance(project.GeneratorConfiguration.GeneratorUnitTestProviderType); - SpecFlowUnitTestConverter testConverter = new SpecFlowUnitTestConverter(generatorProvider); + SpecFlowUnitTestConverter testConverter = new SpecFlowUnitTestConverter(generatorProvider, project.GeneratorConfiguration.AllowDebugGeneratedFiles); var codeNamespace = testConverter.GenerateUnitTestFixture(feature, null, targetNamespace); return codeNamespace; diff --git a/Installer/SpecFlowSetup/SpecFlowSetup.vdproj b/Installer/SpecFlowSetup/SpecFlowSetup.vdproj index 4c32ab2c6..8b4077974 100644 --- a/Installer/SpecFlowSetup/SpecFlowSetup.vdproj +++ b/Installer/SpecFlowSetup/SpecFlowSetup.vdproj @@ -52,19 +52,19 @@ "Entry" { "MsmKey" = "8:_12B423DBA56C8DC0E3B05977AFDCC8BB" - "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_12B423DBA56C8DC0E3B05977AFDCC8BB" - "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" + "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_12B423DBA56C8DC0E3B05977AFDCC8BB" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -124,19 +124,19 @@ "Entry" { "MsmKey" = "8:_277A812A65804F067023A54D435F95E9" - "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" + "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_277A812A65804F067023A54D435F95E9" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_277A812A65804F067023A54D435F95E9" - "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -238,13 +238,13 @@ "Entry" { "MsmKey" = "8:_64C0AC2C36F206D7B415B1588A67AB7D" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_64C0AC2C36F206D7B415B1588A67AB7D" - "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -292,7 +292,7 @@ "Entry" { "MsmKey" = "8:_72BA062375FF32683B46885AB8FB9F3C" - "OwnerKey" = "8:_12B423DBA56C8DC0E3B05977AFDCC8BB" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -304,7 +304,7 @@ "Entry" { "MsmKey" = "8:_72BA062375FF32683B46885AB8FB9F3C" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_12B423DBA56C8DC0E3B05977AFDCC8BB" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -388,19 +388,19 @@ "Entry" { "MsmKey" = "8:_887B7AF445E3CB62E718707DB1A2DB74" - "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" + "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_887B7AF445E3CB62E718707DB1A2DB74" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_887B7AF445E3CB62E718707DB1A2DB74" - "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" + "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -418,7 +418,7 @@ "Entry" { "MsmKey" = "8:_887B7AF445E3CB62E718707DB1A2DB74" - "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -442,19 +442,19 @@ "Entry" { "MsmKey" = "8:_8B7827FFE66F143641790B9E6A834514" - "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_8B7827FFE66F143641790B9E6A834514" - "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" + "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_8B7827FFE66F143641790B9E6A834514" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -472,13 +472,13 @@ "Entry" { "MsmKey" = "8:_ABD5677C265A4D7BC34829F543181C87" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_ABD5677C265A4D7BC34829F543181C87" - "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -567,6 +567,12 @@ } "Entry" { + "MsmKey" = "8:_D87E105E86E344BCB54D1F2D1EA180F3" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_DDB8AF16D8DBB0CE47C567DBC0C19EE8" "OwnerKey" = "8:_CDB5EF528F7640FEF9EE58B3A2D014B2" "MsmSig" = "8:_UNDEFINED" @@ -598,13 +604,19 @@ "Entry" { "MsmKey" = "8:_ED3D10E989AADCAA0A7443322308EE1F" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_ED3D10E989AADCAA0A7443322308EE1F" - "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_EE4A03D8C2544A6280806185DC6D9CCD" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -634,169 +646,169 @@ "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" + "OwnerKey" = "8:_72BA062375FF32683B46885AB8FB9F3C" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" + "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_109CA2795B9A7ADE61C883D41F3F86F5" + "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_F40F425B3B5D4365A81330EA775FCC1B" + "OwnerKey" = "8:_3062EBEC857307CE646864E951AD7CF4" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_8B2D5366F6C941138FF83318D8C65C46" + "OwnerKey" = "8:_E6AD94D42A19F4BF70FED3A0358400E1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_8B7827FFE66F143641790B9E6A834514" + "OwnerKey" = "8:_76FE53DB004302324A1E0E189ECFF22B" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_277A812A65804F067023A54D435F95E9" + "OwnerKey" = "8:_84C757C079461F1C50F74EF2AE7B70B7" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_64C0AC2C36F206D7B415B1588A67AB7D" + "OwnerKey" = "8:_CDB5EF528F7640FEF9EE58B3A2D014B2" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_12B423DBA56C8DC0E3B05977AFDCC8BB" + "OwnerKey" = "8:_DDB8AF16D8DBB0CE47C567DBC0C19EE8" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_72BA062375FF32683B46885AB8FB9F3C" + "OwnerKey" = "8:_76A50A8C2366870C6FF9029C08057BC1" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_3062EBEC857307CE646864E951AD7CF4" + "OwnerKey" = "8:_1AD5B2DAD15CADF7525F6B4F9791283D" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_E6AD94D42A19F4BF70FED3A0358400E1" + "OwnerKey" = "8:_D3C51B67E3B5564BEA7AB170962FA29F" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_76FE53DB004302324A1E0E189ECFF22B" + "OwnerKey" = "8:_2EB9CD8CC0B58F8EF675A33D260D3FCE" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_84C757C079461F1C50F74EF2AE7B70B7" + "OwnerKey" = "8:_BBBD29910145A3B6E935E8D02FEDA996" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_CDB5EF528F7640FEF9EE58B3A2D014B2" + "OwnerKey" = "8:_019055E8025F50104F4EDCD40D23AB47" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_DDB8AF16D8DBB0CE47C567DBC0C19EE8" + "OwnerKey" = "8:_868F4FD1F4C0AB914DA21D1E95D4EED7" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_76A50A8C2366870C6FF9029C08057BC1" + "OwnerKey" = "8:_D5DE8FFC7C8DF908C525F0D8C61D6537" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_1AD5B2DAD15CADF7525F6B4F9791283D" + "OwnerKey" = "8:_5200717186B38682CC469E61FA770589" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_D3C51B67E3B5564BEA7AB170962FA29F" + "OwnerKey" = "8:_0EFD25C2961F3370383FEDE414DD7238" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_2EB9CD8CC0B58F8EF675A33D260D3FCE" + "OwnerKey" = "8:_6E18F9AB5609CE08526FEBCCD51B43B2" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_BBBD29910145A3B6E935E8D02FEDA996" + "OwnerKey" = "8:_65BCD078F68F9A3A16106B29194C0B30" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_019055E8025F50104F4EDCD40D23AB47" + "OwnerKey" = "8:_75A70548B8444C668B2D0462EC9CC366" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_868F4FD1F4C0AB914DA21D1E95D4EED7" + "OwnerKey" = "8:_6E1CCF469FF44C51440438B84FAA9363" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_D5DE8FFC7C8DF908C525F0D8C61D6537" + "OwnerKey" = "8:_8B7827FFE66F143641790B9E6A834514" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_5200717186B38682CC469E61FA770589" + "OwnerKey" = "8:_277A812A65804F067023A54D435F95E9" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_0EFD25C2961F3370383FEDE414DD7238" + "OwnerKey" = "8:_64C0AC2C36F206D7B415B1588A67AB7D" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_6E18F9AB5609CE08526FEBCCD51B43B2" + "OwnerKey" = "8:_109CA2795B9A7ADE61C883D41F3F86F5" "MsmSig" = "8:_UNDEFINED" } "Entry" { "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_65BCD078F68F9A3A16106B29194C0B30" + "OwnerKey" = "8:_12B423DBA56C8DC0E3B05977AFDCC8BB" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -1121,7 +1133,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:TechTalk.SpecFlow.Parser, Version=1.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:TechTalk.SpecFlow.Parser, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL" "ScatterAssemblies" { "_277A812A65804F067023A54D435F95E9" @@ -1378,7 +1390,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:TechTalk.SpecFlow.Reporting, Version=1.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:TechTalk.SpecFlow.Reporting, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL" "ScatterAssemblies" { "_6E1CCF469FF44C51440438B84FAA9363" @@ -1595,7 +1607,7 @@ { "AssemblyRegister" = "3:1" "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:TechTalk.SpecFlow.Generator, Version=1.1.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL" + "AssemblyAsmDisplayName" = "8:TechTalk.SpecFlow.Generator, Version=1.2.0.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL" "ScatterAssemblies" { "_8B7827FFE66F143641790B9E6A834514" @@ -1868,6 +1880,26 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D87E105E86E344BCB54D1F2D1EA180F3" + { + "SourcePath" = "8:..\\..\\Tools\\MsBuild\\TechTalk.SpecFlow.targets" + "TargetName" = "8:TechTalk.SpecFlow.targets" + "Tag" = "8:" + "Folder" = "8:_2D85F2CCE0F64901A8231E38E3C0F2A8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_DDB8AF16D8DBB0CE47C567DBC0C19EE8" { "AssemblyRegister" = "3:1" @@ -1961,6 +1993,26 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_EE4A03D8C2544A6280806185DC6D9CCD" + { + "SourcePath" = "8:..\\..\\Tools\\MsBuild\\TechTalk.SpecFlow.tasks" + "TargetName" = "8:TechTalk.SpecFlow.tasks" + "Tag" = "8:" + "Folder" = "8:_2D85F2CCE0F64901A8231E38E3C0F2A8" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F3E0D5DBC95C9FCB609F519F665BCC92" { "SourcePath" = "8:vslangproj.olb" @@ -2134,14 +2186,14 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:SpecFlow" - "ProductCode" = "8:{613CE73C-2035-4F7D-8A13-C90D9E6273A9}" - "PackageCode" = "8:{A259B4FA-308E-4FE3-A5FF-F62F957F7F41}" + "ProductCode" = "8:{735A442F-1666-43D6-A9C1-44F4605677E0}" + "PackageCode" = "8:{6257E6BC-D807-4484-AB67-42930815077D}" "UpgradeCode" = "8:{A72428B6-8ADB-4EDF-BC23-4BE4E19F01A0}" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:1.1.0" + "ProductVersion" = "8:1.2.0" "Manufacturer" = "8:TechTalk" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" diff --git a/Parser/SpecFlowGenerator.cs b/Parser/SpecFlowGenerator.cs deleted file mode 100644 index fd93b8fc7..000000000 --- a/Parser/SpecFlowGenerator.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using TechTalk.SpecFlow.Parser.Configuration; -using TechTalk.SpecFlow.Parser.SyntaxElements; -using TechTalk.SpecFlow.Parser.UnitTestProvider; - -namespace TechTalk.SpecFlow.Parser -{ - public class SpecFlowGenerator - { - private readonly SpecFlowProject project; - - public SpecFlowGenerator(SpecFlowProject project) - { - this.project = project; - } - - public CodeCompileUnit GenerateTestFileCode(SpecFlowFeatureFile featureFile) - { - return GenerateTestFileCode(featureFile.GetFullPath(project), File.ReadAllText(featureFile.GetFullPath(project))); - } - - public CodeCompileUnit GenerateTestFileCode(string featureFileName, string content) - { - SpecFlowFeatureFile featureFile = GetFeatureFile(featureFileName); - string targetNamespace = GetTargetNamespace(featureFile); - - SpecFlowLangParser parser = new SpecFlowLangParser(project.GeneratorConfiguration.FeatureLanguage); - Feature feature = parser.Parse(new StringReader(content), featureFile.GetFullPath(project)); - - IUnitTestGeneratorProvider generatorProvider = CreateInstance(project.GeneratorConfiguration.GeneratorUnitTestProviderType); - - SpecFlowUnitTestConverter testConverter = new SpecFlowUnitTestConverter(generatorProvider, project.GeneratorConfiguration.AllowDebugGeneratedFiles); - CodeCompileUnit codeCompileUnit = testConverter.GenerateUnitTestFixture(feature, null, targetNamespace); - - return codeCompileUnit; - } - - private static TInterface CreateInstance(Type type) - { - //TODO: better error handling - return (TInterface)Activator.CreateInstance(type); - } - - private SpecFlowFeatureFile GetFeatureFile(string featureFileName) - { - featureFileName = Path.GetFullPath(Path.Combine(project.ProjectFolder, featureFileName)); - var result = project.FeatureFiles.Find(ff => ff.GetFullPath(project).Equals(featureFileName, StringComparison.InvariantCultureIgnoreCase)); - if (result == null) - { - result = new SpecFlowFeatureFile(featureFileName); //TODO: make it project relative - } - return result; - } - - private string GetTargetNamespace(SpecFlowFeatureFile featureFile) - { - if (!string.IsNullOrEmpty(featureFile.CustomNamespace)) - return featureFile.CustomNamespace; - - if (string.IsNullOrEmpty(project.DefaultNamespace)) - return null; - - string targetNamespace = project.DefaultNamespace; - string projectFolder = project.ProjectFolder; - string sourceFileFolder = Path.GetDirectoryName(featureFile.GetFullPath(project)); - if (sourceFileFolder.StartsWith(sourceFileFolder, StringComparison.InvariantCultureIgnoreCase)) - { - string extraFolders = sourceFileFolder.Substring(projectFolder.Length); - if (extraFolders.Length > 0) - { - string[] parts = extraFolders.TrimStart('\\').Split('\\'); - targetNamespace += "." + string.Join(".", - parts.Select(p => p.ToIdentifier()).ToArray()); - } - //targetNamespace += extraFolders.Replace("\\", "."); - } - return targetNamespace; - } - } -} diff --git a/Parser/TechTalk.SpecFlow.Parser.csproj b/Parser/TechTalk.SpecFlow.Parser.csproj index 12a152097..b58fe76c9 100644 --- a/Parser/TechTalk.SpecFlow.Parser.csproj +++ b/Parser/TechTalk.SpecFlow.Parser.csproj @@ -77,8 +77,6 @@ - - @@ -115,4 +113,4 @@ --> - + \ No newline at end of file diff --git a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs index a76b9c675..493f1bdc4 100644 --- a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs +++ b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs @@ -1,13 +1,13 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4918 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.1.0.0 +// Runtime Version:2.0.50727.4918 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ namespace Bowling.SpecFlow { using TechTalk.SpecFlow; diff --git a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs index 4f15ac574..e221ca55a 100644 --- a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs +++ b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs @@ -1,13 +1,13 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4918 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.1.0.0 +// Runtime Version:2.0.50727.4918 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ namespace Bowling.SpecFlow { using TechTalk.SpecFlow; diff --git a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs index 682927f65..92f467376 100644 --- a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs +++ b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs @@ -1,13 +1,13 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4918 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.1.0.0 +// Runtime Version:2.0.50727.4918 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ namespace Bowling.Specflow { using TechTalk.SpecFlow; @@ -56,13 +56,17 @@ public virtual void GutterGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Gutter game", ((string[])(null))); #line 6 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 7 - testRunner.Given("a new bowling game"); +//#indentnext 2 + testRunner.Given("a new bowling game"); #line 8 - testRunner.When("all of my balls are landing in the gutter"); +//#indentnext 2 + testRunner.When("all of my balls are landing in the gutter"); #line 9 - testRunner.Then("my total score should be 0"); +//#indentnext 2 + testRunner.Then("my total score should be 0"); #line hidden testRunner.CollectScenarioErrors(); } @@ -73,17 +77,23 @@ public virtual void BeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Beginners game", ((string[])(null))); #line 11 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 12 - testRunner.Given("a new bowling game"); +//#indentnext 2 + testRunner.Given("a new bowling game"); #line 13 - testRunner.When("I roll 2 and 7"); +//#indentnext 2 + testRunner.When("I roll 2 and 7"); #line 14 - testRunner.And("I roll 3 and 4"); +//#indentnext 2 + testRunner.And("I roll 3 and 4"); #line 15 - testRunner.And("I roll 8 times 1 and 1"); +//#indentnext 2 + testRunner.And("I roll 8 times 1 and 1"); #line 16 - testRunner.Then("my total score should be 32"); +//#indentnext 2 + testRunner.Then("my total score should be 32"); #line hidden testRunner.CollectScenarioErrors(); } @@ -94,13 +104,17 @@ public virtual void AnotherBeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Another beginners game", ((string[])(null))); #line 18 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 19 - testRunner.Given("a new bowling game"); +//#indentnext 2 + 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"); +//#indentnext 2 + 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"); +//#indentnext 2 + testRunner.Then("my total score should be 40"); #line hidden testRunner.CollectScenarioErrors(); } @@ -111,13 +125,17 @@ public virtual void AllStrikes() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All Strikes", ((string[])(null))); #line 23 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 24 - testRunner.Given("a new bowling game"); +//#indentnext 2 + testRunner.Given("a new bowling game"); #line 25 - testRunner.When("all of my rolls are strikes"); +//#indentnext 2 + testRunner.When("all of my rolls are strikes"); #line 26 - testRunner.Then("my total score should be 300"); +//#indentnext 2 + testRunner.Then("my total score should be 300"); #line hidden testRunner.CollectScenarioErrors(); } @@ -128,13 +146,17 @@ public virtual void OneSingleSpare() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("One single spare", ((string[])(null))); #line 28 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 29 - testRunner.Given("a new bowling game"); +//#indentnext 3 + 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"); +//#indentnext 3 + 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"); +//#indentnext 3 + testRunner.Then("my total score should be 29"); #line hidden testRunner.CollectScenarioErrors(); } @@ -145,15 +167,20 @@ public virtual void AllSpares() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All spares", ((string[])(null))); #line 33 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 34 - testRunner.Given("a new bowling game"); +//#indentnext 2 + testRunner.Given("a new bowling game"); #line 35 - testRunner.When("I roll 10 times 1 and 9"); +//#indentnext 2 + testRunner.When("I roll 10 times 1 and 9"); #line 36 - testRunner.And("I roll 1"); +//#indentnext 2 + testRunner.And("I roll 1"); #line 37 - testRunner.Then("my total score should be 110"); +//#indentnext 2 + 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 6dcc025dc..cc45c189c 100644 --- a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs +++ b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs @@ -1,13 +1,13 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4918 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.1.0.0 +// Runtime Version:2.0.50727.4918 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ namespace Bowling.Specflow { using TechTalk.SpecFlow; @@ -56,13 +56,17 @@ public virtual void OneSingleSpare() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("One single spare", ((string[])(null))); #line 7 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 8 - testRunner.Given("a new bowling game"); +//#indentnext 2 + 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"); +//#indentnext 2 + 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"); +//#indentnext 2 + testRunner.Then("my total score should be 29"); #line hidden testRunner.CollectScenarioErrors(); } @@ -73,15 +77,20 @@ public virtual void AllSpares() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("All spares", ((string[])(null))); #line 12 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 13 - testRunner.Given("a new bowling game"); +//#indentnext 2 + testRunner.Given("a new bowling game"); #line 14 - testRunner.When("I roll 10 times 1 and 9"); +//#indentnext 2 + testRunner.When("I roll 10 times 1 and 9"); #line 15 - testRunner.And("I roll 1"); +//#indentnext 2 + testRunner.And("I roll 1"); #line 16 - testRunner.Then("my total score should be 110"); +//#indentnext 2 + testRunner.Then("my total score should be 110"); #line hidden testRunner.CollectScenarioErrors(); } @@ -92,9 +101,11 @@ public virtual void YetAnotherBeginnersGame() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Yet another beginners game", ((string[])(null))); #line 18 -this.ScenarioSetup(scenarioInfo); +//#indentnext 0 + this.ScenarioSetup(scenarioInfo); #line 19 - testRunner.Given("a new bowling game"); +//#indentnext 2 + testRunner.Given("a new bowling game"); #line hidden TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { "Pins"}); @@ -139,9 +150,11 @@ public virtual void YetAnotherBeginnersGame() table1.AddRow(new string[] { "1"}); #line 20 - testRunner.When("I roll", ((string)(null)), table1); +//#indentnext 2 + testRunner.When("I roll", ((string)(null)), table1); #line 42 - testRunner.Then("my total score should be 43"); +//#indentnext 2 + testRunner.Then("my total score should be 43"); #line hidden testRunner.CollectScenarioErrors(); } diff --git a/Tools/TechTalk.SpecFlow.Tools.csproj b/Tools/TechTalk.SpecFlow.Tools.csproj index 308579ce3..7b015951e 100644 --- a/Tools/TechTalk.SpecFlow.Tools.csproj +++ b/Tools/TechTalk.SpecFlow.Tools.csproj @@ -75,12 +75,12 @@ - + PreserveNewest - - + + PreserveNewest - +