Compartilhar via


TestCategoryBaseAttribute Class

Definition

Base class for the "Category" attribute

public ref class TestCategoryBaseAttribute abstract : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=true)]
public abstract class TestCategoryBaseAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=true)>]
type TestCategoryBaseAttribute = class
    inherit Attribute
Public MustInherit Class TestCategoryBaseAttribute
Inherits Attribute
Inheritance
TestCategoryBaseAttribute
Derived
Attributes

Remarks

The reason for this attribute is to let the users create their own implementation of test categories. - test framework (discovery, etc) deals with TestCategoryBaseAttribute. - The reason that TestCategories property is a collection rather than a string, is to give more flexibility to the user. For instance the implementation may be based on enums for which the values can be OR'ed in which case it makes sense to have single attribute rather than multiple ones on the same test.

Constructors

TestCategoryBaseAttribute()

Initializes a new instance of the TestCategoryBaseAttribute class. Applies the category to the test. The strings returned by TestCategories are used with the /category command to filter tests

Properties

TestCategories

Gets the test category that has been applied to the test.

Applies to