Why do my SpecFlow tests not show up in Visual Studio Test window?

▼魔方 西西 提交于 2019-12-01 04:46:55
Andreas Willich

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.

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

Update your NUnit Test Adapter to NUnit3 Test Adapter. Restart Visual Studio and rebuild the tests should show up.

SayusiAndo

If you want to your tests - the unit tests generated by Specflow, just for being precise - displayed in your unit test explorer you must create Unit test project. If you created a class library project then you won't see them.

Here you can find information about how you can convert your class library project to unit test project.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!