如何从命令提示符执行NUnit测试用例 [英] How to execute NUnit test cases from command prompt
问题描述
如何使用NUnit从命令控制台执行测试用例?我有一套基于NUnit框架的用C#编写的Selenium测试.我只需要从命令控制台运行就可以执行测试用例.
How can I execute a test case from Command Console using NUnit? I had set of Selenium Tests written in C# based on NUnit framework. I need to execute the test cases simply by running from command console.
在JUnit中,我们可以通过
In JUnit we can run test case from cmd as
java junit.swingui.TestRunner test.Run
我们如何在NUnit中做以上的事情?
How can we do above in NUnit?
推荐答案
使用 nunit-console.exe
运行从命令行进行测试.
Use nunit-console.exe
to run tests from the command line.
例如:
nunit-console.exe /xml:results.xml path/to/test/assembly.dll
这将运行单元测试并将结果保存在result.xml文件中,您可以轻松地使用它.
This will run the unit tests and save the results in the results.xml file, which you can work with easily.
有关所有各种信息,请参见文档.可用的命令行开关.
See the documentation for all of the various command line switches that are available.
这篇关于如何从命令提示符执行NUnit测试用例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!