TestCategoryBaseAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
“Category”属性的基类。
public ref class TestCategoryBaseAttribute abstract : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)]
public abstract class TestCategoryBaseAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)]
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class TestCategoryBaseAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=true)]
public abstract class TestCategoryBaseAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)>]
type TestCategoryBaseAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)>]
[<System.Runtime.CompilerServices.Nullable(0)>]
type TestCategoryBaseAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=true)>]
type TestCategoryBaseAttribute = class
inherit Attribute
Public MustInherit Class TestCategoryBaseAttribute
Inherits Attribute
- 继承
-
TestCategoryBaseAttribute
- 派生
- 属性
注解
此属性的原因是让用户创建自己的测试类别实现。 - 测试框架(发现等)处理 TestCategoryBaseAttribute。 - TestCategories 属性是集合而不是字符串的原因是为用户提供更大的灵活性。 例如,实现可能基于可对值进行 OR 的枚举,在这种情况下,在同一测试中具有单个属性而不是多个属性是有意义的。
构造函数
| 名称 | 说明 |
|---|---|
| TestCategoryBaseAttribute() |
初始化 TestCategoryBaseAttribute 类的新实例。 将类别应用于测试。 TestCategories 返回的字符串与 /category 命令一起使用来筛选测试。 |
属性
| 名称 | 说明 |
|---|---|
| TestCategories |
获取已应用于测试的测试类别。 |