简体   繁体   English

NUnit 输出未显示在保存的 XML 报告中

[英]NUnit output not shown in saved XML report

I am using NUnit 2.6 and have the following test case:我正在使用 NUnit 2.6 并有以下测试用例:

[Test]
public void TestCase()
{
    ....test case code....

// Success
Console.WriteLine("---------------->Test Passed<----------------");
}

After the test case is executed, the results are exported to an XML file (/xml=C:\\TestResult.xml).执行测试用例后,结果将导出到 XML 文件 (/xml=C:\\TestResult.xml)。 In the resulting XML file, the console text "-->Test Passed<--" is not saved.在生成的 XML 文件中,不会保存控制台文本“-->Test Passed<--”。 Is there a way to show the Console.WriteLines in the XML file?有没有办法在 XML 文件中显示 Console.WriteLines?

Command line:命令行:

"nunit-console-x86.exe" "Test.dll" /xml=C:\TestResult.xml /Domain=None /noshadow

NUnit V2 does not save the output you write in the XML result at all. NUnit V2 根本不保存您在 XML 结果中写入的输出。 NUnit 3 adds an output element that contains the text written by each test. NUnit 3 添加了一个output元素,其中包含每个测试编写的文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM