Class TimeoutAttribute
Applies a timeout in milliseconds to a test. When applied to a method, the test is cancelled if the timeout is exceeded. When applied to a class or assembly, the default timeout is set for all contained test methods.
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
[Obsolete(".NET No longer supports aborting threads as it is not a safe thing to do. Update your tests to use CancelAfterAttribute instead")]
public class TimeoutAttribute : PropertyAttribute, IApplyToTest, IApplyToContext
Constructors
View SourceTimeoutAttribute(int)
Construct a TimeoutAttribute given a time in milliseconds
Declaration
public TimeoutAttribute(int timeout)
Parameters
Type | Name | Description |
---|---|---|
int | timeout | The timeout value in milliseconds |