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 SourceApplyToAsync<TActual>(Func<Task<TActual>>)
Applies the constraint to a delegate that returns the task. The default implementation simply evaluates the delegate and awaits the task but derived classes may override it to provide for delayed processing.
Declaration
public override Task<ConstraintResult> ApplyToAsync<TActual>(Func<Task<TActual>> taskDel)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<TActual>> | taskDel |
Returns
| Type | Description |
|---|---|
| Task<ConstraintResult> |
Type Parameters
| Name | Description |
|---|---|
| TActual |
Overrides
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 SourceGetStringRepresentation()
Returns the string representation of the constraint.
Declaration
protected override string GetStringRepresentation()
Returns
| Type | Description |
|---|---|
| string |