Operation class

Provides a set of static methods for instrumenting concurrency primitives that can then be controlled during testing.

public static class Operation

Public Members

name description
static CreateFrom(…) Creates a new controlled operation from the specified builder and returns its unique id, or null if the test engine is detached.
static CreateNext() Creates a new controlled operation and returns its unique id, or null if the test engine is detached.
static GetNextId() Returns the next available unique operation id, or null if the test engine is detached.
static OnCompleted() Notifies that the currently executing operation has completed.
static OnStarted(…) Notifies that the operation with the specified id has started executing.
static PauseUntil(…) Pauses the currently executing operation until the specified condition gets resolved.
static PauseUntilAsync(…) Asynchronously pauses the currently executing operation until the operation with the specified id completes. If resumeAsynchronously is set to true, then after the asynchronous pause, a new operation will be created to execute the continuation.
static PauseUntilCompleted(…) Pauses the currently executing operation until the operation with the specified id completes.
static PauseUntilCompletedAsync(…) Asynchronously pauses the currently executing operation until the operation with the specified id completes. If resumeAsynchronously is set to true, then after the asynchronous pause, a new operation will be created to execute the continuation.
static RegisterCallSite(…) Registers the method invoked by the currently executing operation.
static ScheduleNext() Schedules the next enabled operation, which can include the currently executing operation.
static Start(…) Starts executing the operation with the specified id.
static TryReset(…) Tries to reset the the operation with the specified id so that it can be reused. This is only allowed if the operation is already completed.

Remarks

These methods are thread-safe and no-op unless the test engine is attached.

See Also