feature.cs file generation can we control the function name
hi All,
We are using specflow 3.9 with excel files to pass the test data to the scenarios. We are using visual studio 2019 and C#. When we add a new data row in the excel file and rebuild the project, an additional test is generated in the Test Explorer. The test name is in the format "Scenario Name + _ExternalExamples_ + data from first field in the row". When we look at the generated the feature.cs file, the function is named as "Scenario Name _ExternalExamples_ data from first field in the row".
Is there any way we can generate the test name in the format "data from first field in the row + Scenario Name + _ExternalExamples_" ?
Thanks in Advance
Krishna.
-
I am able to make the change in the code to get the test case names as per our requirement. Can someone help on how to get this change added? If others do not need this change, can this be added with a parameter?
TechTalk.SpecFlow.Generator\Generation\UnitTestMethodGenerator.cs
methodName = string.IsNullOrEmpty(exampleSetIdentifier)
//? $"_{methodName}_{variantNameIdentifier}"
//: $"_{methodName}_{exampleSetIdentifier}_{variantNameIdentifier}";
? $"_{variantNameIdentifier}_{methodName}"
: $"_{variantNameIdentifier}_{exampleSetIdentifier}_{methodName}";0
Please sign in to leave a comment.
Comments
1 comment