unit-testing - NUnit 类别未显示在 Visual Studio 中

标签 unit-testing visual-studio-2012 nunit

我想按功能对我的测试进行自定义分组,因此我使用了 nunit Category 属性,如下所示:

[Test, Category("Cat1")]
public void SomeMethod() { }

[Test, Category("Cat2")]
public void AnotherMethod() { }

但是在 Visual Studio 中没有显示类别,我看到的只是按持续时间或测试结果分组的默认值。我正在使用:
  • NUnit 2.6.4
  • Visual Studio 2012
  • NUnit 测试适配器 2.0.0.0

  • 我错过了什么?这似乎应该是一个明智的选择

    最佳答案

    您应该能够通过 Traits 对您的测试进行分组,其中包括 Category属性。如果你不能,那么你可能需要更新 your Visual Studio to at least Update 1 .针对 MS 框架的更详细描述是 here但是 TestAdapter 似乎允许它与 NUnit Category 属性一起正常工作。

    关于unit-testing - NUnit 类别未显示在 Visual Studio 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30891415/

    相关文章:

    c# - 检测顶层框架 BHO

    c# - 是否有使用 NUnit 测试复杂函数的通用方法?

    c# - CollectionAssert.AreEqual 失败。 (索引 0 处的元素不匹配。)

    unit-testing - 覆盖插件(引擎盖下的Cobertura)是否报告了Spock规范?

    python - 如何对验证日期时间是否为特定 ISO 格式的函数进行单元测试?

    c# - 如何只分析一个类库?

    .net - Visual Studio 项目加载错误 : The attribute "Include" in element <EmbeddedResource> is unrecognized

    c#-4.0 - Nunit 2.6.2 Suite 运行两次而不是一次

    c# - 添加 NUnit 2.6.1 引用 Visual Studio 2012

    python - 带有可选键的字典策略