TestAttribute Class

Definition

Adding this attribute to a method within a class makes the method callable from the NUnit test runner. There is a property called Description which is optional which you can provide a more detailed test description. This class cannot be inherited.

[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class TestAttribute : NUnit.Framework.NUnitAttribute, NUnit.Framework.Internal.IApplyToTest
type TestAttribute = class
    inherit NUnitAttribute
    interface IApplyToTest
Inheritance
TestAttribute
Attributes
Implements

Examples

[TestFixture] public class Fixture { [Test] public void MethodToTest() {} [Test(Description = "more detailed description")] publc void TestDescriptionMethod() {} }

Constructors

TestAttribute()

Properties

Description

Descriptive text for this test

Methods

ApplyToTest(Test)

Applies to