I’ve compiled a regular expression to use in Visual Studio’s Find and Replace
dialogue to cleanup the extra information generated by SpecFlow and NUnit when it finds missing steps in your stepdefinition files.
1 |
(\*\*.*)|(^(Given)|(When)|(Then)|(And).*)|(-\>.*)|(\[Binding\]~(\n:b+public class ~(StepDefinitions)))|(^:b+public class StepDefinitions.*\n:b^4\{)|(^ \}~(\n\}))|(^ ~( ).*)|(\n:b*\n:b*\n) |
Just make sure you’ve selected to Use: Regular Expressions
below the Find Options
group. Run a replace all with an empty string in your **Current Document
** to clean up. To remove the extra lines, run the replace all a second time 🙂