Class RepeatAttribute
Specifies that a test should be run multiple times.
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class RepeatAttribute : PropertyAttribute, IApplyToTest, IRepeatTest, ICommandWrapper
Constructors
View SourceRepeatAttribute(int)
Construct a RepeatAttribute
Declaration
public RepeatAttribute(int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | count | The number of times to run the test |
RepeatAttribute(int, bool)
Construct a RepeatAttribute
Declaration
public RepeatAttribute(int count, bool stopOnFailure)
Parameters
| Type | Name | Description |
|---|---|---|
| int | count | The number of times to run the test |
| bool | stopOnFailure | Whether to stop when a test is not successful or not |
Properties
View SourceStopOnFailure
Whether to stop when a test is not successful or not
Declaration
public bool StopOnFailure { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceWrap(TestCommand)
Wrap a command and return the result.
Declaration
public TestCommand Wrap(TestCommand command)
Parameters
| Type | Name | Description |
|---|---|---|
| TestCommand | command | The command to be wrapped |
Returns
| Type | Description |
|---|---|
| TestCommand | The wrapped command |