c# - 如何不在 nUnit 2.6.4 xml 结果中显示堆栈跟踪?

标签 c# xml xsd nunit

我有一个与控制台运行器一起运行的 nunit 测试 dll,它有很多失败的测试,但有异常(exception)。生成的 xml 文件太大,我认为避免在 xml 输出中写入堆栈跟踪是个好主意,因为在我的情况下,显示根本没有用,只能写入异常消息。

然而,事实证明这比我预期的要困难得多。 我看到了这两个链接,where to find the xsd file that nunit useshow to customize the xml ,但在 2.6.4 中,控制台上的 /transform 选项似乎已被弃用,唉。

我不确定如何更改 files在我的 nUnit 安装目录中,这会影响输出吗?如果有人设法更改了 nUnit 的 xml 结果输出,他们能否指出正确的方向?

最佳答案

nunit 目前看起来不可能。在您提到它被另一个工具使用后环顾四周。

找到 This在 nunit 讨论板上。它说了以下内容:

您可能已经知道,NUnit 没有任何内置的方法来 自定义 XML 文件的内容。我们将为 NUnit 努力 3.0,但对于 NUnit 2.x,有必要构建一个修改后的副本 NUnit的。

The XML result file is created by the XmlResultWriter class, which is part of the nunit.util assembly. See http://bazaar.launchpad.net/~nunit-core/nunitv2/trunk/view/head:/src/ClientUtilities/util/XmlResultWriter.cs

关于c# - 如何不在 nUnit 2.6.4 xml 结果中显示堆栈跟踪?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31025699/

相关文章:

c# - NetworkStream.CanRead 返回 true 但缓冲区不返回任何值

c# - 锁定可枚举可能会导致多重枚举吗?

c# - 在 WebBrowser 控件中转义 TabStop

php - 使用 xpath 选择第一个结果的 child

java - android.os.TransactionTooLargeException 检索已安装的应用程序

c# - 我应该如何重构一长串 try-and-catch-wrapped 投机操作

c# - 编写事件的简短方法?

xml - Ruby XML 到 JSON 转换器?

web-services - 使用 SOAPUI 连接 Web 服务时出错

.Net SvcUtil : attributes must be optional