[英]How can I output results of tests ran with NUnit 3?
Since yesterday I am trying to figure out how to create that XML report that NUnit3 can produce and I just can't find a single example with code.从昨天开始,我就试图弄清楚如何创建 NUnit3 可以生成的 XML 报告,但我找不到带有代码的单个示例。
What should I do in order to make NUnit 3 produce the results file or what and where should I be looking for?我应该怎么做才能使 NUnit 3 生成结果文件,或者我应该在哪里寻找什么?
This can definitely be done using nunit3-console.exe
to run your project.这绝对可以使用nunit3-console.exe
来运行您的项目。
From a CMD/PowerShell console, call \\path\\to\\nunit3-console.exe \\path\\to\\your.dll
.从 CMD/PowerShell 控制台,调用\\path\\to\\nunit3-console.exe \\path\\to\\your.dll
。 A TestResult.xml
file is created in \\myProjectFolder\\bin\\Debug
by default.默认情况下, TestResult.xml
文件在\\myProjectFolder\\bin\\Debug
创建。 You can also add the -out=
flag to additionally create a custom log.您还可以添加-out=
标志来额外创建自定义日志。
For instance, \\path\\to\\nunit3-console.exe \\path\\to\\your.dll -out=\\path\\to\\whereever\\testResultFileName.xml
.例如, \\path\\to\\nunit3-console.exe \\path\\to\\your.dll -out=\\path\\to\\whereever\\testResultFileName.xml
。 With a simple project, have a [Test]
and a Console.WriteLine()
.对于一个简单的项目,有一个[Test]
和一个Console.WriteLine()
。 The testname and print statement will show up in your custom file. testname 和 print 语句将显示在您的自定义文件中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.