如何在 Windows 上安装 NUnit 3 控制台并运行测试? [英] How do I install NUnit 3 console on Windows and run tests?
问题描述
我想从这样的控制台运行测试(在任何目录中,DLL 文件可以用于不同的 .NET 版本):
I want to run tests from a console like this (being in any directory, the DLL file can be for a different .NET version):
$ nunit3-console test.dll
我在谷歌上搜索了很多,但找不到如何设置.
I googled a lot, but can't find how to set up this.
官方教程没有任何用处,完全为零.跟随它让我无处可去:https://github.com/nunit/docs/wiki/Installation一个>
The official tutorial has nothing useful and is complete zero. Following it gets me nowhere: https://github.com/nunit/docs/wiki/Installation
推荐答案
很难找到,因为有很多过时的文档,无论是 NUnit2 还是 NUnit3.
It is hard to find, because there is a lot of outdated documentation, either for NUnit2 or NUnit3.
步骤:
- 官方 NUnit3 控制台安装程序在这里:https://github.com/nunit/nunit-console/releases(路径与文档中的不同)
- 下载
NUnit.Console-*.msi
包并安装 - 添加到系统
PATH
变量:C:\Program Files (x86)\NUnit.org\nunit-console
- 打开命令行
类型:
- Official NUnit3 console installers are here: https://github.com/nunit/nunit-console/releases (path is different than in docs)
- Download
NUnit.Console-*.msi
package and install - Add to system
PATH
variable this:C:\Program Files (x86)\NUnit.org\nunit-console
- Open command line
Type:
$ nunit3-console test.dll
//要并行运行多个测试程序集,请参阅: https://stackoverflow.com/a/45486444/1453525
这篇关于如何在 Windows 上安装 NUnit 3 控制台并运行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!