2017-08-03 178 views
2

我想逃离这样的控制台测试(在任何目录之中,DLL可以是不同的.NET版本):如何在Windows中安装NUnit 3控制台并运行测试?

$ nunit3-console test.dll 

我GOOGLE了很多,但无法找到如何设置这个。 官方教程没有任何用处,完全为零,因为它让我无处可寻:https://github.com/nunit/docs/wiki/Installation

+0

[本节](https://github.com/nunit/docs/wiki/Installation#downloading -z-zip文件)似乎解释了如何做得很清楚? –

+0

Downloaded zip不包含'nunit3-console.exe',只有'nunitlite-runner.exe'。 –

+0

够公平的。然后他们需要更新他们的文档。你总是可以回溯到仍然包含nunit3控制台的发行版并下载它。 –

回答

6

很难找到,因为有很多过时的文档,无论是NUnit2还是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. 类型:

    $ nunit3-console test.dll

//对于以并行方式请参阅运行多个测试组件:https://stackoverflow.com/a/45486444/1453525