Interface IWait<T>
Interface describing a class designed to wait for a condition.
public interface IWait<T>
Type Parameters
T
The type of object used to detect the condition.
Properties
Message
Gets or sets the message to be displayed when time expires.
string Message { get; set; }
Property Value
PollingInterval
Gets or sets how often the condition should be evaluated.
TimeSpan PollingInterval { get; set; }
Property Value
Timeout
Gets or sets how long to wait for the evaluated condition to be true.
TimeSpan Timeout { get; set; }
Property Value
Methods
IgnoreExceptionTypes(params Type[])
Configures this instance to ignore specific types of exceptions while waiting for a condition. Any exceptions not whitelisted will be allowed to propagate, terminating the wait.
void IgnoreExceptionTypes(params Type[] exceptionTypes)
Parameters
exceptionTypes
Type[]The types of exceptions to ignore.
Until<TResult>(Func<T, TResult?>)
Waits until a condition is true or times out.
TResult Until<TResult>(Func<T, TResult?> condition)
Parameters
condition
Func<T, TResult>A delegate taking a TSource as its parameter, and returning a TResult.
Returns
- TResult
If TResult is a boolean, the method returns true when the condition is true, and false otherwise. If TResult is an object, the method returns the object when the condition evaluates to a value other than null.
Type Parameters
TResult
The type of result to expect from the condition.
Exceptions
- ArgumentException
Thrown when TResult is not boolean or an object type.