Search code examples
c#visual-studionunitspecflow

The tests are not shown in specflow + nunit3 with Visual Studio 2017


I'm starting with BDD and spec-flow in C# and Visual Studio. I was following a tutorial at https://www.toolsqa.com/specflow/set-up-specflow/ to set up a project but I cannot be shown the tests in visual studio 2017 to run.

The steps I take are the following:

  1. I create a project as a class library in the .NET Framework
  2. I add spec-flow to the project
  3. I add the NuGet Nunit test adapter and Nunit Framework (version3)
  4. I generate the .feature file
  5. I generate the file steps associated with the feature.
  6. I compile the solution but in the test window I don't see any tests that run

I searched for several tutorials but I can't find what my mistake is or what I'm missing.

Can anyone help me?


Solution

  • Install the "SpecFlow.Tools.MsBuild.Generation" nuget package and rebuild the solution. That should get you going.