Class
WaitSync

Waits Synchronously for a condition.

Definition

Namespace:ArtOfTest.Common

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class WaitSync : WaitAsync

Inheritance: objectWaitAsyncWaitSync

Inherited Members WaitAsync.OnWaitComplete(WaitCompleteEventArgs)WaitAsync.CheckIntervalWaitAsync.WaitCompleted

Constructors

WaitSync(int, int)

Create a new synchronous wait object.

Declaration

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

Parameters

timeout

int

The global timeout to use for all waits on this method.

checkInterval

int

The condition wait interval to use.

Properties

AutoCheckResult

Gets or sets whether to automatically check for timeouts or errors once the wait is done. Default is true.

Declaration

cs-api-definition
public bool AutoCheckResult { get; set; }

Property Value

bool

Remarks

If this value is set to false then the user calling .For will need to manually check the SyncWaitResult when the call comes back.

PendingTaskTimeout

Gets or sets additional time to wait for a pending task when wait times out.

Declaration

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

Property Value

int

SyncWaitResult

Gets the result of the last synchronous wait.

Declaration

cs-api-definition
public WaitResult SyncWaitResult { get; }

Property Value

WaitResult

Methods

CheckResult(WaitSync)

Check the result of a WaitSync.

Declaration

cs-api-definition
public static void CheckResult(WaitSync wait)

Parameters

wait

WaitSync

The wait object.

CheckResult(WaitSync, string, object)

Check the sync wait result.

Declaration

cs-api-definition
public static void CheckResult(WaitSync wait, string extraExceptionInfo, object target = null)

Parameters

wait

WaitSync

extraExceptionInfo

string

target

object

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

Wait for a custom condition defined by func on a pooled thread.

Declaration

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

Parameters

func

Func<T, V, bool>

The function delegate

target

T

The target object instance to pass to function.

custom

V

The custom object instance to pass to function.

invertCondition

bool

True/false to invert the condition.

timeout

int

The time out to use.

Overrides WaitAsync.For<T, V>(Func<T, V, bool>, T, V, bool, int)

Remarks

Function does not throw on timeout. Check the SyncWaitResult to figure out if the call timed-out..etc.

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

Declaration

cs-api-definition
public override 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

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

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

Wait for a custom condition defined by func on a pooled thread.

Declaration

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

Parameters

func

Func<T, V, bool>

The function delegate

target

T

The target object instance to pass to function.

custom

V

The custom object instance to pass to function.

timeout

int

The time out to use.

Remarks

Function does not throw on timeout. Check the SyncWaitResult to figure out if the call timed-out..etc.

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

Wait for a specific assert.

Declaration

cs-api-definition
public void For<T>(Func<T, bool> assert, T control, int timeout, int checkInterval, object target)

Parameters

assert

Func<T, bool>

The assert to use. Control.AssertXXXX

control

T

The target control

timeout

int

The timeout to use

checkInterval

int

The check interval to use.

target

object

Target object to execute this method against

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

Wait for a custom condition defined by predicate on a pooled thread.

Declaration

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

Parameters

predicate

Predicate<T>

Predicate function to call.

target

T

The target object instance to pass to predicate.

invertCondition

bool

True/false to invert the condition.

timeout

int

The time out to use.

Overrides WaitAsync.For<T>(Predicate<T>, T, bool, int)

Remarks

Function does not throw on timeout. Check the SyncWaitResult to figure out if the call timed-out..etc.

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

Declaration

cs-api-definition
public override 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

Overrides WaitAsync.For<T>(Predicate<T>, T, bool, int, WaitResultType)

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

Wait for a custom condition defined by predicate on a pooled thread.

Declaration

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

Parameters

predicate

Predicate<T>

Predicate function to call.

target

T

The target object instance to pass to predicate.

timeout

int

The time out to use.

Remarks

Function does not throw on timeout. Check the SyncWaitResult to figure out if the call timed-out..etc.