Why don't my SpecFlow tests appear in the Visual Studio Test window?

I read the Getting Started tutorial for SpecFlow. Everything worked perfectly, except that I have a @SpecRun test because I did not enter a demo key.

But in our main project, we use NUnit instead of SpecFlow + Runner. So I tried to imitate this project. If you use NUnit, you will not need a demo key. So I replaced Unit Test Provider with:

<specFlow>
  <unitTestProvider name="NUnit" />
</specFlow>

I also compared links to my links to main project links. I find that I can take out TechTalk.SpecRun and the project will still compile. Of course, TechTalk.SpecFlow is required.

If I select SpecRun.SpecFlowPlugin, the tests will not appear except @SpecRun, which is a delay of tests without a demo key.

I also see the csharp file in the main project: SpecFlowNUnitExtension.cs. I cited this file, but my tests still do not appear in the Visual Studio testing window. Is there anything I need to do to register this file?

+4
source share
3 answers

You need a test adapter adapter for Visual Studio to get the tests in the test explorer. They are distributed by NuGet packages. Add the package for your test taker to your test project.

  • SpecFlow + Runner: SpecRun.Runner
  • NUnit2: NUnitTestAdapter
  • NUnit3: NUnit3TestAdapter
  • XUnit: xunit.runner.visualstudio
  • MsTest: no additional adapter required
+8
source

NUnit NUnit3. Visual Studio .

+4

- , Specflow, unit test, unit test. , .

, unit test.

0
source

Source: https://habr.com/ru/post/1651288/


All Articles