SpecFlow steps generation and general Rider changes

Search for a command to run...

No comments yet. Be the first to comment.
Phew, that was a lot. I'm always surprised how simple solutions contain so much detail and nuance when I try to explain them. I hope I conveyed the message that A-Frame simplifies code within a module or class by separating the infrastructure compone...

No architecture is complete without an easy way to test the functionality. My recommended strategy is to use two types of tests: unit and integration. As far as test setup goes, there is no clear winner for a test framework. xUnit.NET, NUnit and the ...

The examples in the previous posts seem really nice for simple scenarios. How do I approach more advanced use cases? The big scenarios are: I need multiple pieces of data from different sources I need to perform an infrastructure call in the middle...

I’ve shown how I write code using the A-Frame architecture without help. Yet I find a library or framework very convenient when using advanced techniques. Wolverine is at its core a messaging framework, but goes well beyond that. It has an in-memory ...

Now the expected structure is clear, let's take a look at the code. I will start with a minimal API implementation to demonstrate that there is no need for a framework to implement this architecture. I do know of a framework that makes A-Frame effort...

In May of this year, I wrote an article on how to get JetBrains Rider to generate SpecFlow files. The biggest problem I still had back then was that I couldn't generate the step definitions. I finally found a workaround so I don't need to use Visual Studio anymore.
After creating a test project with the full dotnet framework, I add the SpecFlow and SpecFlow.xUnit packages. I insert a .feature file and write a test. The save generates the .feature.cs file (see my previous article how to set that up).
Now that I can execute the test, I just run it.

In the test output window is the basic setup for the current steps. Just copy and paste the steps into a new file and enjoy the steps generation. When I write a new Given, When or Then step, I just rerun the test and check the output for the method signature.

Have fun generating feature steps in Rider.
While setting up a small test environment, I found out SpecFlow isn't dotnet core compliant yet, but they're hard at work to make that happen. Keep up the good work guys!
While installing the SpecFlow packages, I found out the default dotnet core packages location changed from the solution folder to the C:\Users\[UserName]\.nuget\packages folder.
In Rider, there is a nice feature to nest files. In the Solution window, there is a button to open the File Nesting window. Just add a Parent file suffix with ".feature" and a Child file suffix of ".feature.cs; .steps.cs".
Now feature files will nicely be nested.
Hopefully these tips and tricks will prove useful to some Rider users out there.