I have gone through the Getting Started tutorial for SpecFlow. Everything worked fine except that I have the @SpecRun test because I have not entered a demo key.
But in our main project we use NUnit instead of SpecFlow+ Runner. So I tried to mimic that project. If you use NUnit you won't need the demo key. So I changed the Unit Test Provider to:
<specFlow>
<unitTestProvider name="NUnit" />
</specFlow>
I also compared my tutorial references to the main project's references. I find that I can take out TechTalk.SpecRun and the project will still compile. Of course TechTalk.SpecFlow is needed.
If I take out SpecRun.SpecFlowPlugin, no tests show up except @SpecRun which is the tests delay without the demo key.
I also see in the main project a csharp file called: SpecFlowNUnitExtension.cs. I brought in this file but my tests still do not show up in the Visual Studio Test window. Is there something I need to do to register this file?
You need a test runner adapter for Visual Studio to get the tests in the test explorer. They are distributed by NuGet packages. Add the package for your test runner to your test project.
Update your NUnit Test Adapter to NUnit3 Test Adapter. Restart Visual Studio and rebuild the tests should show up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With