Class
WaitAsync

Enables asynchronized waiting on custom conditions

Definition

Namespace:ArtOfTest.Common

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class WaitAsync

Inheritance: objectWaitAsync

Derived Classes: WaitSync

Constructors

WaitAsync(int, int)

Create a new WaitAsync object.

Declaration

cs-api-definition
public WaitAsync(int timeout, int checkInterval)

Parameters

timeout

int

The global timeout to use for this wait async object.

checkInterval

int

The check interval to use for condition checking.

Properties

CheckInterval

Gets or sets the check interval for this wait object.

Declaration

cs-api-definition
public int CheckInterval { get; set; }

Property Value

int

Methods

For<T, V>(Func<T, V, bool>, T, V, bool, int)

Wait for an action async. Attach to WaitCompleted to get notification when wait is completed

Declaration

cs-api-definition
public virtual void For<T, V>(Func<T, V, bool> func, T target, V custom, bool invertCondition, int timeout)

Parameters

func

Func<T, V, bool>

The wait function delegate

target

T

The target object instance we are waiting on.

custom

V

The custom object instance to pass to the wait function.

invertCondition

bool

True/false whether to invert the condition

timeout

int

The timeout to use.

For<T, V>(Func<T, V, bool>, T, V, bool, int, WaitResultType)

Declaration

cs-api-definition
public virtual void For<T, V>(Func<T, V, bool> func, T target, V custom, bool invertCondition, int timeout, WaitResultType errorResultType)

Parameters

func

Func<T, V, bool>

target

T

custom

V

invertCondition

bool

timeout

int

errorResultType

WaitResultType

For<T>(Predicate<T>, T, bool, int)

Wait for an action async. Attach to WaitCompleted to get notification when wait is completed

Declaration

cs-api-definition
public virtual void For<T>(Predicate<T> predicate, T target, bool invertCondition, int timeout)

Parameters

predicate

Predicate<T>

The function delegate

target

T

The actual target object instance

invertCondition

bool

Whether to invert the condition

timeout

int

The timeout to use.

For<T>(Predicate<T>, T, bool, int, WaitResultType)

Declaration

cs-api-definition
public virtual void For<T>(Predicate<T> predicate, T target, bool invertCondition, int timeout, WaitResultType errorResultType)

Parameters

predicate

Predicate<T>

target

T

invertCondition

bool

timeout

int

errorResultType

WaitResultType

OnWaitComplete(WaitCompleteEventArgs)

Invoke the wait complete event.

Declaration

cs-api-definition
protected void OnWaitComplete(WaitCompleteEventArgs args)

Parameters

args

WaitCompleteEventArgs

WaitCompleteEventArgs

Events

WaitCompleted

Triggered when the wait operation is completed

Declaration

cs-api-definition
public event EventHandler<WaitCompleteEventArgs> WaitCompleted

Event Value

EventHandler<WaitCompleteEventArgs>