如何在Visual Studio 2017中运行NUnit测试? [英] How to run NUnit tests in Visual Studio 2017?

查看:265
本文介绍了如何在Visual Studio 2017中运行NUnit测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了VS2017.我有一个使用NUnit作为测试用例的项目. Ctrl + R - T 不再运行测试,并且测试资源管理器"不再找到标记有TestCase属性的测试用例.

I've just installed VS 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.

是否有一种方法可以使NUnit运行,或者可以找到更新?我从Nuget软件包管理器重新安装了NUnit,但没有任何改进.

Is there a way to get NUnit running yet, or an update I could find? I re-installed NUnit from the Nuget Package Manager to the latest version with no improvement.

推荐答案

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

Add the NUnit test adapter NuGet package to your test projects

  • 2.* (https://www.nuget.org/packages/NUnitTestAdapter/)
  • 3.* (https://www.nuget.org/packages/NUnit3TestAdapter/)

或安装测试适配器" Visual Studio扩展.

Or install the Test Adapter visual studio extension. There is one for

  • 2.* (https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnitTestAdapter)
  • 3.* (https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter).

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

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.

这篇关于如何在Visual Studio 2017中运行NUnit测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆