我想按功能对我的测试进行自定义分组,因此我使用了 nunit Category 属性,如下所示:
[Test, Category("Cat1")]
public void SomeMethod() { }
[Test, Category("Cat2")]
public void AnotherMethod() { }
但是在 Visual Studio 中没有显示类别,我看到的只是按持续时间或测试结果分组的默认值。我正在使用:
我错过了什么?这似乎应该是一个明智的选择
最佳答案
您应该能够通过 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/