如何在 Windows 上安装 NUnit 3 控制台并运行测试? [英] How do I install NUnit 3 console on Windows and run tests?

查看:69
本文介绍了如何在 Windows 上安装 NUnit 3 控制台并运行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从这样的控制台运行测试(在任何目录中,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.

步骤:

  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://stackoverflow.com/a/45486444/1453525

这篇关于如何在 Windows 上安装 NUnit 3 控制台并运行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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