且构网

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

如何在 Windows 上安装 NUnit 3 控制台并运行测试?

更新时间:2023-02-21 08:20:47

很难找到,因为有很多过时的文档,无论是 NUnit2 还是 NUnit3.

It is hard to find, because there is a lot of outdated documentation, either for NUnit2 or NUnit3.

步骤:

  1. 官方 NUnit3 控制台安装程序在这里:https://github.com/nunit/nunit-console/releases(路径与文档中的不同)
  2. 下载NUnit.Console-*.msi包并安装
  3. 添加到系统 PATH 变量:C:\Program Files (x86)\NUnit.org\nunit-console
  4. 打开命令行
  5. 类型:

  1. Official NUnit3 console installers are here: https://github.com/nunit/nunit-console/releases (path is different than in docs)
  2. Download NUnit.Console-*.msi package and install
  3. Add to system PATH variable this: C:\Program Files (x86)\NUnit.org\nunit-console
  4. Open command line
  5. Type:

$ nunit3-console test.dll

//要并行运行多个测试程序集,请参阅: https://***.com/a/45486444/1453525