TestAttribute 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
Attributes
Implements

Examples

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

Constructors

TestAttribute() TestAttribute()

Properties

Description Description

Descriptive text for this test

Methods

ApplyToTest(Test) ApplyToTest(Test)

Applies to