Visual Studio 中未显示 NUnit 类别

NUnit Categories not showing up in Visual Studio

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

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

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

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

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

您应该能够按 Traits 对测试进行分组,其中包括 Category 属性。如果你不能那么你可能需要更新 your Visual Studio to at least Update 1. A more detailed description, targeted at the MS framework is here 但 TestAdapter 似乎允许它与 NUnit Category 属性一起正常工作。