ClassWaitSync
Waits Synchronously for a condition.
Definition
Namespace:ArtOfTest.Common
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class WaitSync : WaitAsync
Inheritance: objectWaitAsyncWaitSync
Inherited Members
Constructors
WaitSync(int, int)
Create a new synchronous wait object.
Properties
AutoCheckResult
Gets or sets whether to automatically check for timeouts or errors once the wait is done. Default is true.
Declaration
public bool AutoCheckResult { get; set; }
Property Value
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.
SyncWaitResult
Gets the result of the last synchronous wait.
Methods
CheckResult(WaitSync)
Check the result of a WaitSync.
Declaration
public static void CheckResult(WaitSync wait)
Parameters
wait
The wait object.
CheckResult(WaitSync, string, object)
Check the sync wait result.
For<T, V>(Func<T, V, bool>, T, V, bool, int)
Wait for a custom condition defined by func on a pooled thread.
Declaration
public override void For<T, V>(Func<T, V, bool> func, T target, V custom, bool invertCondition, int timeout)
Parameters
func
The function delegate
target
T
The target object instance to pass to function.
custom
V
The custom object instance to pass to function.
invertCondition
True/false to invert the condition.
timeout
The time out to use.
Overrides
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
public override void For<T, V>(Func<T, V, bool> func, T target, V custom, bool invertCondition, int timeout, WaitResultType errorResultType)
Parameters
func
target
T
custom
V
invertCondition
timeout
errorResultType
Overrides
For<T, V>(Func<T, V, bool>, T, V, int)
Wait for a custom condition defined by func on a pooled thread.
Declaration
public void For<T, V>(Func<T, V, bool> func, T target, V custom, int timeout)
Parameters
func
The function delegate
target
T
The target object instance to pass to function.
custom
V
The custom object instance to pass to function.
timeout
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
public void For<T>(Func<T, bool> assert, T control, int timeout, int checkInterval, object target)
Parameters
assert
The assert to use. Control.AssertXXXX
control
T
The target control
timeout
The timeout to use
checkInterval
The check interval to use.
target
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
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
True/false to invert the condition.
timeout
The time out to use.
Overrides
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
public override void For<T>(Predicate<T> predicate, T target, bool invertCondition, int timeout, WaitResultType errorResultType)
Parameters
predicate
Predicate<T>
target
T
invertCondition
timeout
errorResultType
Overrides
For<T>(Predicate<T>, T, int)
Wait for a custom condition defined by predicate on a pooled thread.
Declaration
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
The time out to use.
Remarks
Function does not throw on timeout. Check the SyncWaitResult to figure out if the call timed-out..etc.