Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 9c670e8

Browse files
SlowLogicBoystajs
authored andcommitted
Add SpecFlowVersion argument (#82)
* Add SpecFlowVersion argument * Remove unecessary line * Add Necessary lines * Update Version
1 parent 063fe8d commit 9c670e8

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

src/SpecFlow.NetCore/Args.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ namespace Specflow.NetCore
99
internal class Args
1010
{
1111
public const string SpecFlowPathArgName = "--specflow-path";
12+
public const string SpecFlowVersionArgName = "--specflow-version";
1213
public const string WorkingDirectoryArgName = "--working-directory";
1314
public const string TestFrameworkArgName = "--test-framework";
1415
public const string ToolsVersionArgName = "--tools-version";
1516

1617
public string SpecFlowPath { get; }
18+
public string SpecFlowVersion { get; }
1719
public DirectoryInfo WorkingDirectory { get; }
1820
public string TestFramework { get; }
1921
public string ToolsVersion { get; }
@@ -29,6 +31,7 @@ public Args(string[] args)
2931
var argDictionary = new Dictionary<string, string>
3032
{
3133
{ SpecFlowPathArgName, null },
34+
{ SpecFlowVersionArgName, null },
3235
{ WorkingDirectoryArgName, null },
3336
{ TestFrameworkArgName, null },
3437
{ ToolsVersionArgName, null }
@@ -63,6 +66,10 @@ public Args(string[] args)
6366
SpecFlowPath = argDictionary[key];
6467
break;
6568

69+
case SpecFlowVersionArgName:
70+
SpecFlowVersion = argDictionary[key];
71+
break;
72+
6673
case WorkingDirectoryArgName:
6774
var path = string.IsNullOrEmpty(argDictionary[key]) ? Directory.GetCurrentDirectory() : argDictionary[key];
6875
if (!Directory.Exists(path))
@@ -81,6 +88,7 @@ public Args(string[] args)
8188
}
8289

8390
WriteLine("SpecFlowPath: " + SpecFlowPath);
91+
WriteLine("SpecFlowVersion: " + SpecFlowVersion);
8492
WriteLine("WorkingDirectory: " + WorkingDirectory.FullName);
8593
WriteLine("TestFramework: " + TestFramework);
8694
WriteLine("ToolsVersion: " + ToolsVersion);

src/SpecFlow.NetCore/Fixer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ internal class Fixer
1919
private readonly string _toolsVersion;
2020
private string _specFlowVersion;
2121

22-
public Fixer(string specFlowPath = null, string testFramework = null, string toolsVersion = "14.0")
22+
public Fixer(string specFlowPath = null, string specFlowVersion = null, string testFramework = null, string toolsVersion = "14.0")
2323
{
2424
_specFlowExe = specFlowPath;
2525
_testFramework = testFramework;
2626
_toolsVersion = toolsVersion;
27+
_specFlowVersion = specFlowVersion;
2728
}
2829

2930
private static string FindSpecFlow(string version)

src/SpecFlow.NetCore/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static int Main(string[] args)
1010
try
1111
{
1212
var a = new Args(args);
13-
var fixer = new Fixer(a.SpecFlowPath, a.TestFramework, a.ToolsVersion);
13+
var fixer = new Fixer(a.SpecFlowPath, a.SpecFlowVersion, a.TestFramework, a.ToolsVersion);
1414
fixer.Fix(a.WorkingDirectory);
1515

1616
PrintUsingColor("SpecFlow fixed.", ConsoleColor.Green);

src/SpecFlow.NetCore/SpecFlow.NetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
2121
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
2222
<PackageReleaseNotes></PackageReleaseNotes>
23-
<Version>1.3.3</Version>
23+
<Version>1.3.4</Version>
2424
</PropertyGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)