Class DelayedConstraint
Applies a delay to the match so that a match can be evaluated in the future.
Inheritance
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class DelayedConstraint : PrefixConstraint, IConstraint, IResolveConstraint
Constructors
View SourceDelayedConstraint(IConstraint, int)
Creates a new DelayedConstraint
Declaration
public DelayedConstraint(IConstraint baseConstraint, int delayInMilliseconds)
Parameters
Type | Name | Description |
---|---|---|
IConstraint | baseConstraint | The inner constraint to decorate |
int | delayInMilliseconds | The time interval after which the match is performed |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | If the value of |
DelayedConstraint(IConstraint, int, int)
Creates a new DelayedConstraint
Declaration
public DelayedConstraint(IConstraint baseConstraint, int delayInMilliseconds, int pollingIntervalInMilliseconds)
Parameters
Type | Name | Description |
---|---|---|
IConstraint | baseConstraint | The inner constraint to decorate |
int | delayInMilliseconds | The time interval after which the match is performed, in milliseconds |
int | pollingIntervalInMilliseconds | The time interval used for polling, in milliseconds |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | If the value of |
Properties
View SourceDelayInterval
Delay value store as an Interval object
Declaration
protected Interval DelayInterval { get; set; }
Property Value
Type | Description |
---|---|
Interval |
Description
Gets text describing a constraint
Declaration
public override string Description { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
View SourcePollingInterval
Polling value stored as an Interval object
Declaration
protected Interval PollingInterval { get; set; }
Property Value
Type | Description |
---|---|
Interval |
Methods
View SourceApplyTo<TActual>(ActualValueDelegate<TActual>)
Test whether the constraint is satisfied by a delegate
Declaration
public override ConstraintResult ApplyTo<TActual>(ActualValueDelegate<TActual> del)
Parameters
Type | Name | Description |
---|---|---|
ActualValueDelegate<TActual> | del | The delegate whose value is to be tested |
Returns
Type | Description |
---|---|
ConstraintResult | A ConstraintResult |
Type Parameters
Name | Description |
---|---|
TActual |
Overrides
View SourceApplyTo<TActual>(TActual)
Test whether the constraint is satisfied by a given value
Declaration
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
Type | Name | Description |
---|---|---|
TActual | actual | The value to be tested |
Returns
Type | Description |
---|---|
ConstraintResult | True for if the base constraint fails, false if it succeeds |
Type Parameters
Name | Description |
---|---|
TActual |
Overrides
View SourceApplyTo<TActual>(ref TActual)
Test whether the constraint is satisfied by a given reference. Overridden to wait for the specified delay period before calling the base constraint with the dereferenced value.
Declaration
public override ConstraintResult ApplyTo<TActual>(ref TActual actual)
Parameters
Type | Name | Description |
---|---|---|
TActual | actual | A reference to the value to be tested |
Returns
Type | Description |
---|---|
ConstraintResult | True for success, false for failure |
Type Parameters
Name | Description |
---|---|
TActual |
Overrides
View SourceGetStringRepresentation()
Returns the string representation of the constraint.
Declaration
protected override string GetStringRepresentation()
Returns
Type | Description |
---|---|
string |