diff --git a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/AppConfigDriver.cs b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/AppConfigDriver.cs index bd04d9fd1..5446c9fc7 100644 --- a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/AppConfigDriver.cs +++ b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/AppConfigDriver.cs @@ -4,7 +4,7 @@ namespace Reqnroll.TestProjectGenerator { public class AppConfigDriver { - public string TestProjectFolderName => ConfigurationManager.AppSettings["testProjectFolder"] ?? "SF"; + public string TestProjectFolderName => ConfigurationManager.AppSettings["testProjectFolder"] ?? "RR"; public string VSTestPath => ConfigurationManager.AppSettings["vstestPath"] ?? "Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow"; } } \ No newline at end of file diff --git a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/AppConfigGenerator.cs b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/AppConfigGenerator.cs index f21921fb9..0951d4a60 100644 --- a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/AppConfigGenerator.cs +++ b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/AppConfigGenerator.cs @@ -64,11 +64,6 @@ private void WriteReqnroll(XmlWriter writer, Configuration configuration) { writer.WriteStartElement("reqnroll"); - if (_currentVersionDriver.ReqnrollVersion < new Version(3, 0)) - { - WriteUnitTestProvider(writer, configuration.UnitTestProvider.ToName()); - } - if (configuration.BindingCulture != null) { WriteBindingCulture(writer, configuration.BindingCulture); @@ -91,11 +86,6 @@ private void WriteReqnroll(XmlWriter writer, Configuration configuration) WriteStepAssemblies(writer, configuration.StepAssemblies); - if (_currentVersionDriver.ReqnrollVersion < new Version(3, 0)) - { - WritePlugins(writer, configuration.Plugins); - } - writer.WriteEndElement(); } diff --git a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/JsonConfigGenerator.cs b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/JsonConfigGenerator.cs index ebed3fbcf..2db1ef28a 100644 --- a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/JsonConfigGenerator.cs +++ b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/Factories/ConfigurationGenerator/JsonConfigGenerator.cs @@ -44,11 +44,6 @@ private void WriteReqnroll(JsonWriter jsonWriter, Configuration configuration) { configuration.FeatureLanguage = configuration.FeatureLanguage ?? CultureInfo.GetCultureInfo("en-US"); - if (_currentVersionDriver.ReqnrollVersion < new Version(3, 0)) - { - WriteUnitTestProvider(jsonWriter, configuration.UnitTestProvider.ToName()); - } - if (configuration.FeatureLanguage != null) { WriteLanguage(jsonWriter, configuration.FeatureLanguage); @@ -70,11 +65,6 @@ private void WriteReqnroll(JsonWriter jsonWriter, Configuration configuration) } WriteStepAssemblies(jsonWriter, configuration.StepAssemblies); - - if (_currentVersionDriver.ReqnrollVersion < new Version(3, 0)) - { - WritePlugins(jsonWriter, configuration.Plugins); - } } private void WriteUnitTestProvider(JsonWriter jsonWriter, string unitTestProvider) diff --git a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/ProjectBuilder.cs b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/ProjectBuilder.cs index d3f2e4211..37d4ec3c2 100644 --- a/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/ProjectBuilder.cs +++ b/Reqnroll.TestProjectGenerator/Reqnroll.TestProjectGenerator/ProjectBuilder.cs @@ -232,15 +232,8 @@ private void EnsureProjectExists() _project.AddNuGetPackage("System.Runtime.CompilerServices.Unsafe", "6.0.0", new NuGetPackageAssembly("System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "netstandard2.0\\System.Runtime.CompilerServices.Unsafe.dll")); } - if (_currentVersionDriver.ReqnrollVersion >= new Version(3, 0)) - { - // TODO: dei replace this hack with better logic when SpecFlow 3 can be strong name signed - _project.AddNuGetPackage("Reqnroll", _currentVersionDriver.ReqnrollNuGetVersion, new NuGetPackageAssembly("Reqnroll", "net462\\Reqnroll.dll")); - } - else - { - _project.AddNuGetPackage("Reqnroll", $"{_currentVersionDriver.ReqnrollNuGetVersion}", new NuGetPackageAssembly($"Reqnroll, Version={_currentVersionDriver.ReqnrollVersion}.0, Culture=neutral, PublicKeyToken=0778194805d6db41, processorArchitecture=MSIL", "net462\\Reqnroll.dll")); - } + // TODO: dei replace this hack with better logic when SpecFlow 3 can be strong name signed + _project.AddNuGetPackage("Reqnroll", _currentVersionDriver.ReqnrollNuGetVersion, new NuGetPackageAssembly("Reqnroll", "net462\\Reqnroll.dll")); _project.AddNuGetPackage("BoDi", "1.5.0", new NuGetPackageAssembly("BoDi, Version=1.5.0.0, Culture=neutral, PublicKeyToken=ff7cd5ea2744b496", "net45\\BoDi.dll")); _project.AddNuGetPackage("Gherkin", "19.0.3", new NuGetPackageAssembly("Gherkin, Version=19.0.3.0, Culture=neutral, PublicKeyToken=86496cfa5b4a5851", "net45\\Gherkin.dll")); @@ -264,36 +257,15 @@ private void EnsureProjectExists() if (IsReqnrollFeatureProject) { - if (_currentVersionDriver.ReqnrollVersion >= new Version(2, 3, 0)) - { - _project.AddNuGetPackage("Reqnroll.Tools.MsBuild.Generation", _currentVersionDriver.ReqnrollNuGetVersion); - } - else - { - _project.AddMSBuildImport($"..\\packages\\Reqnroll.{_currentVersionDriver.ReqnrollVersion}\\tools\\Reqnroll.targets"); - } - - if (_project.ProjectFormat == ProjectFormat.Old && _currentVersionDriver.ReqnrollVersion < new Version(3, 0, 0)) - { - AddMSBuildTarget("AfterUpdateFeatureFilesInProject", @" - - "); - } + _project.AddNuGetPackage("Reqnroll.Tools.MsBuild.Generation", _currentVersionDriver.ReqnrollNuGetVersion); } switch (Configuration.UnitTestProvider) { case UnitTestProvider.SpecRun: - ConfigureRunner(); - break; - case UnitTestProvider.SpecRunWithNUnit: - ConfigureRunner(); - ConfigureNUnit(); - break; case UnitTestProvider.SpecRunWithMsTest: - ConfigureRunner(); - ConfigureMSTest(); - break; + case UnitTestProvider.SpecRunWithNUnit: + throw new NotSupportedException("Testing with SpecRun is not supported!"); case UnitTestProvider.MSTest: ConfigureMSTest(); break; @@ -306,12 +278,6 @@ private void EnsureProjectExists() default: throw new InvalidOperationException(@"Invalid unit test provider."); } - - if (_currentVersionDriver.ReqnrollVersion < new Version(3, 0)) - { - _project.AddNuGetPackage("Newtonsoft.Json", "11.0.2"); - } - } _project.AddNuGetPackage("FluentAssertions", "5.3.0"); @@ -325,7 +291,7 @@ private void ConfigureNUnit() _project.AddNuGetPackage(NUnit3TestAdapterPackageName, NUnit3TestAdapterPackageVersion); - if (_currentVersionDriver.ReqnrollVersion >= new Version(3, 0) && IsReqnrollFeatureProject) + if (IsReqnrollFeatureProject) { _project.AddNuGetPackage("Reqnroll.NUnit", _currentVersionDriver.ReqnrollNuGetVersion, new NuGetPackageAssembly(GetReqnrollPublicAssemblyName("Reqnroll.NUnit.ReqnrollPlugin.dll"), "net462\\Reqnroll.NUnit.ReqnrollPlugin.dll")); @@ -360,7 +326,7 @@ private void ConfigureXUnit() _project.AddNuGetPackage("Validation", "2.4.18", new NuGetPackageAssembly("Validation, Version=2.4.0.0, Culture=neutral, PublicKeyToken=2fc06f0d701809a7", "net45\\Validation.dll")); } - if (_currentVersionDriver.ReqnrollVersion >= new Version(3, 0) && IsReqnrollFeatureProject) + if (IsReqnrollFeatureProject) { _project.AddNuGetPackage("Reqnroll.xUnit", _currentVersionDriver.ReqnrollNuGetVersion, new NuGetPackageAssembly(GetReqnrollPublicAssemblyName("Reqnroll.xUnit.ReqnrollPlugin.dll"), "net462\\Reqnroll.xUnit.ReqnrollPlugin.dll")); @@ -381,7 +347,7 @@ private void ConfigureMSTest() "Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL", "net45\\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll")); - if (_currentVersionDriver.ReqnrollVersion >= new Version(3, 0) && IsReqnrollFeatureProject) + if (IsReqnrollFeatureProject) { _project.AddNuGetPackage("Reqnroll.MSTest", _currentVersionDriver.ReqnrollNuGetVersion, new NuGetPackageAssembly(GetReqnrollPublicAssemblyName("Reqnroll.MSTest.ReqnrollPlugin.dll"), "net462\\Reqnroll.MSTest.ReqnrollPlugin.dll")); @@ -389,49 +355,6 @@ private void ConfigureMSTest() } } - private void ConfigureRunner() - { - _project.AddNuGetPackage("SpecRun.Runner", _currentVersionDriver.NuGetVersion); - - if (_currentVersionDriver.ReqnrollVersion >= new Version(3, 0)) - { - if (IsReqnrollFeatureProject) - { - ConfigureRunnerForSpecFlow3(); - } - } - else - { - ConfigureRunnerForSpecFlow2(); - } - - } - - private void ConfigureRunnerForSpecFlow2() - { - _project.AddNuGetPackage($"SpecRun.Reqnroll.{_currentVersionDriver.ReqnrollVersionDash}", _currentVersionDriver.NuGetVersion, - new NuGetPackageAssembly($"SpecRun.ReqnrollPlugin, Version={_currentVersionDriver.MajorMinorPatchVersion}, Culture=neutral, processorArchitecture=MSIL", "net45\\SpecRun.ReqnrollPlugin.dll"), - new NuGetPackageAssembly($"TechTalk.SpecRun, Version={_currentVersionDriver.MajorMinorPatchVersion}, Culture=neutral, PublicKeyToken=d0fc5cc18b3b389b, processorArchitecture=MSIL", - "net45\\TechTalk.SpecRun.dll"), - new NuGetPackageAssembly($"TechTalk.SpecRun.Common, Version={_currentVersionDriver.MajorMinorPatchVersion}, Culture=neutral, PublicKeyToken=d0fc5cc18b3b389b, processorArchitecture=MSIL", - "net45\\TechTalk.SpecRun.Common.dll") - ); - - Configuration.Plugins.Add(new ReqnrollPlugin("SpecRun")); - } - - private void ConfigureRunnerForSpecFlow3() - { - _project.AddNuGetPackage($"SpecRun.Reqnroll.{_currentVersionDriver.ReqnrollVersionDash}", _currentVersionDriver.NuGetVersion, - new NuGetPackageAssembly($"SpecRun.Runtime.ReqnrollPlugin, Version={_currentVersionDriver.MajorMinorPatchVersion}, Culture=neutral, processorArchitecture=MSIL", - $"{TargetFrameworkMoniker}\\SpecRun.Runtime.ReqnrollPlugin.dll"), - new NuGetPackageAssembly($"TechTalk.SpecRun, Version={_currentVersionDriver.MajorMinorPatchVersion}, Culture=neutral, PublicKeyToken=d0fc5cc18b3b389b, processorArchitecture=MSIL", - $"{TargetFrameworkMoniker}\\TechTalk.SpecRun.dll"), - new NuGetPackageAssembly($"TechTalk.SpecRun.Common, Version={_currentVersionDriver.MajorMinorPatchVersion}, Culture=neutral, PublicKeyToken=d0fc5cc18b3b389b, processorArchitecture=MSIL", - $"{TargetFrameworkMoniker}\\TechTalk.SpecRun.Common.dll") - ); - } - protected virtual void AddAdditionalStuff() { } @@ -497,13 +420,7 @@ public void AddNuGetPackage(string nugetPackage, string nugetVersion = null) private void AddInternalJson() { - string internalJsonPublicAssemblyName = InternalJsonPackageName; - if (_currentVersionDriver.ReqnrollVersion < new Version(3, 0)) - { - internalJsonPublicAssemblyName = $"{internalJsonPublicAssemblyName}, Version={InternalJsonVersion}, Culture=neutral, PublicKeyToken=0778194805d6db41"; - } - - _project.AddNuGetPackage($"{InternalJsonPackageName}", $"{InternalJsonVersion}", new NuGetPackageAssembly($"{internalJsonPublicAssemblyName}", "net45\\SpecFlow.Internal.Json.dll")); + _project.AddNuGetPackage($"{InternalJsonPackageName}", $"{InternalJsonVersion}", new NuGetPackageAssembly($"{InternalJsonPackageName}", "net45\\SpecFlow.Internal.Json.dll")); } } }