CategoryAttribute Class

Summary

Applies a category to a test
Namespace
TCLite
Interfaces
Base Types
graph BT Type-->Base0["TCLiteAttribute"] click Base0 "/tc-lite/api/TCLite/TCLiteAttribute" Base0-->Base1["Attribute"] Base1-->Base2["object"] Type-.->Interface0["IApplyToTest"] click Interface0 "/tc-lite/api/TCLite.Interfaces/IApplyToTest" Type["CategoryAttribute"] class Type type-node

Syntax

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class CategoryAttribute : TCLiteAttribute, IApplyToTest

Attributes

Type Description
AttributeUsageAttribute

Constructors

Name Summary
CategoryAttribute() Protected constructor uses the Type name as the name of the category.
CategoryAttribute(string) Construct attribute for a given category based on a name. The name may not contain the characters ',', '+', '-' or '!'. However, this is not checked in the constructor since it would cause an error to arise at as the test was loaded without giving a clear indication of where the problem is located. The error is handled in NUnitFramework.cs by marking the test as not runnable.

Properties

Name Value Summary
Categories List<string>
The categories specified by this attribute

Methods

Name Value Summary
ApplyToTest(ITest) void
Modifies a test by adding a category to it.