resharper 不会忽略 XUnit 中标有类别属性的测试
resharper is not ignoring tests marked with Category Attribute in XUnit
拥有:
[Category("Contract")]
public class ProgramClientShould
{
}
或:
[Trait("Contract", null)]
public class ProgramClientShould
{
}
和 Resharper -> 选项 -> 工具 -> 单元测试:
"Skip tests from categories" 值为 "Contract"
仍然执行 ProgramClientShould 中的测试。怎么了?
xunit 没有 Category
属性,因此 resharper 运行器无法识别。至于 trait 属性,你需要提供一个值,然后过滤出 key[value]
格式的东西。例如。如果你想使用 [Trait("Owner", "Matt")]
,你将筛选 Owner[Matt]
.
类别
特征键 Category
的处理方式不同,仅使用值,因此 [Trait("Category", "integration")]
将使用 integration
作为 resharper 选项中的类别过滤器。
拥有:
[Category("Contract")]
public class ProgramClientShould
{
}
或:
[Trait("Contract", null)]
public class ProgramClientShould
{
}
和 Resharper -> 选项 -> 工具 -> 单元测试: "Skip tests from categories" 值为 "Contract"
仍然执行 ProgramClientShould 中的测试。怎么了?
xunit 没有 Category
属性,因此 resharper 运行器无法识别。至于 trait 属性,你需要提供一个值,然后过滤出 key[value]
格式的东西。例如。如果你想使用 [Trait("Owner", "Matt")]
,你将筛选 Owner[Matt]
.
特征键 Category
的处理方式不同,仅使用值,因此 [Trait("Category", "integration")]
将使用 integration
作为 resharper 选项中的类别过滤器。