且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Visual Studio 2017 中运行 NUnit 测试?

更新时间:2022-12-22 10:05:09

将 NUnit 测试适配器 NuGet 包添加到您的测试项目

或者安装测试适配器 Visual Studio 扩展.有一个

我更喜欢 NuGet 包,因为它将与您的项目使用的 NUnit 版本同步,因此会自动匹配任何构建服务器中使用的版本.

I've just installed Visual Studio 2017. I have a project using NUnit for the test cases. Ctrl + R - T no longer runs the tests, and the Test Explorer no longer finds any test cases marked with the TestCase attribute.

Is there a way to get NUnit running yet, or an update I could find?

I reinstalled NUnit from the NuGet Package Manager to the latest version with no improvement.

Add the NUnit test adapter NuGet package to your test projects

Or install the Test Adapter Visual Studio extension. There is one for

I prefer the NuGet package, because it will be in sync with the NUnit version used by your project and will thus automatically match the version used in any build server.