Skip to content

Commit

Permalink
Fix for GH#6 - Create Step Definitions generates Reqnroll using State…
Browse files Browse the repository at this point in the history
…ments for SpecFlow projects (#13)

Co-authored-by: Gáspár Nagy <[email protected]>
  • Loading branch information
clrudolphi and gasparnagy authored Mar 11, 2024
1 parent 86872fa commit 9f95c1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# [vNext]

* FIX for Create Step Definition Snippets Generates Reqnroll Using Statements for SpecFlow Projects #6
* Fix for GH7 - "Find step definitions usages command not visible for SpecFlow projects

# v2024.1.49 - 2024-02-08
Expand Down
5 changes: 4 additions & 1 deletion Reqnroll.VisualStudio/Editor/Commands/DefineStepsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ private void SaveAsStepDefinitionClass(IProjectScope projectScope, string combin
targetFolder = stepDefinitionsFolder;
fileNamespace = fileNamespace + ".StepDefinitions";
}
var projectTraits = projectScope.GetProjectSettings().ReqnrollProjectTraits;
var isSpecFlow = projectTraits.HasFlag(ReqnrollProjectTraits.LegacySpecFlow) || projectTraits.HasFlag(ReqnrollProjectTraits.SpecFlowCompatibility);
var libraryNameSpace = isSpecFlow ? "SpecFlow" : "Reqnroll";

var template = "using System;" + newLine +
"using Reqnroll;" + newLine +
$"using {libraryNameSpace};" + newLine +
newLine +
$"namespace {fileNamespace}" + newLine +
"{" + newLine +
Expand Down

0 comments on commit 9f95c1e

Please sign in to comment.