Table of Contents

Class CancelAfterAttribute

Namespace
NUnit.Framework
Assembly
nunit.framework.dll

Applies a timeout in milliseconds to a test. When applied to a method, the test's cancellation token is cancelled if the timeout is exceeded.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class CancelAfterAttribute : PropertyAttribute, IApplyToTest, IApplyToContext
Inheritance
CancelAfterAttribute
Implements
Inherited Members

Remarks

The user has to monitor this cancellation token.

Constructors

CancelAfterAttribute(int)

Construct a CancelAfterAttribute given a time in milliseconds

public CancelAfterAttribute(int timeout)

Parameters

timeout int

The timeout value in milliseconds