【问题标题】:NUnit Categories not showing up in Visual StudioNUnit 类别未显示在 Visual Studio 中
【发布时间】:2015-06-17 12:18:47
【问题描述】:

我想按功能自定义我的测试分组,所以我使用 nunit 类别属性,如下所示:

[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

我错过了什么?这看起来应该是不费吹灰之力

【问题讨论】:

    标签: unit-testing visual-studio-2012 nunit


    【解决方案1】:

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

    【讨论】:

    • 就是这样!谢谢你的信息。 VIsual Studio 是我通常安装的那些东西之一,然后在我安装下一个主要版本之前不要碰,我需要更好地更新我的工作版本。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-15
    • 2011-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多