Testdriven.net NCover 集成:从覆盖率报告中排除方法

发布于 2024-09-13 04:23:22 字数 71 浏览 1 评论 0原文

我正在使用 Testdriven.net 在我的程序集上运行 NCover。但是,我需要从覆盖率报告中排除某些方法。我该怎么做?

I am using Testdriven.net to run NCover on my assemblies. However, I need to exclude certain methods from the coverage report. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坠似风落 2024-09-20 04:23:22

这可以通过在全局(有时称为空)命名空间中声明名为 CoverageExcludeAttribute 的属性并将该属性应用于您想要从 NCover 中排除的方法来实现。

Ncover 将仅通过其名称来获取此属性,因此无需引用任何外部程序集。另请参阅此帖子。 (它没有提到 CoverageExcludeAttribute 必须在全局命名空间中定义)。

This can be achieved by declaring an Attribute named CoverageExcludeAttribute in the global (sometimes referred to as the empty) namespace and applying this Attribute on the methods you want excluded from NCover.

NCover will pick up this attribute by its name only, so there's no need to reference any external assemblies. See also this post. (It doesn't mention that the CoverageExcludeAttribute must be defined in the global namespace).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文