Table of Contents

Class IgnoreAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

Attribute used to mark a test that is to be ignored. Ignored tests result in a warning message when the tests are run.

[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class IgnoreAttribute : NUnitAttribute, IApplyToTest
Inheritance
IgnoreAttribute
Implements
Inherited Members

Constructors

IgnoreAttribute(string)

Constructs the attribute giving a reason for ignoring the test

public IgnoreAttribute(string reason)

Parameters

reason string

The reason for ignoring the test

Properties

Until

The date in the future to stop ignoring the test as a string in UTC time. For example for a date and time, "2014-12-25 08:10:00Z" or for just a date, "2014-12-25". If just a date is given, the Ignore will expire at midnight UTC.

public string Until { get; set; }

Property Value

string

Remarks

Once the ignore until date has passed, the test will be marked as runnable. Tests with an ignore until date will have an IgnoreUntilDate property set which will appear in the test results.

Exceptions

FormatException

The string does not contain a valid string representation of a date and time.

Methods

ApplyToTest(Test)

Modifies a test by marking it as Ignored.

public void ApplyToTest(Test test)

Parameters

test Test

The test to modify