【问题标题】:filtering a category in dotcover过滤dotcover中的类别
【发布时间】:2012-07-13 13:33:25
【问题描述】:

我知道您可以过滤项目、类和方法,但是否可以过滤 dotcover 中的类别。 我正在使用 nuit 作为我的单元测试器。 请帮忙! 谢谢 皮特

【问题讨论】:

    标签: nunit filtering categories dotcover


    【解决方案1】:

    Peter,你是对的,你不能通过 dotCover 中的覆盖过滤器来做到这一点,但你仍然可以在 nunit 控制台运行程序中指定要包含或排除的类别 (documentation)

    【讨论】:

      【解决方案2】:

      可以从命令行。只需将 /include:MyCategoryName 设置为 TargetArguments 中的第一个参数,然后是目标 dll。

      dotcover.exe analyse coverage.config.xml
      

      coverage.config.xml 看起来像这样...

      <?xml version="1.0" encoding="utf-8"?>
      <AnalyseParams>
          <TargetExecutable>Thirdparty\NUnit-2.5.10.11092\bin\net-2.0\nunit-console.exe</TargetExecutable>
          <TargetArguments>/include:MyCategoryName bin/release/MyAssemblyUnderTest.dll
          </TargetArguments>
          <TargetWorkingDir>.</TargetWorkingDir>
          ...
      

      提示:如果您在环境变量 --> 路径变量中有 dotcover.exe 的位置会有所帮助。

      欲了解更多信息running dotcover from the command line

      【讨论】:

        猜你喜欢
        • 2016-04-29
        • 1970-01-01
        • 2015-02-25
        • 1970-01-01
        • 1970-01-01
        • 2021-05-18
        • 2014-06-04
        • 2011-10-29
        • 1970-01-01
        相关资源
        最近更新 更多