Interface ITestScheduler
Abstraction for polling and time-based operations. All of such operations function based on registering callbacks to an instance of this interface. See also RetryingPoller for an implementation you may use for poll callbacks.
Namespace: Responsible
Assembly: Responsible.dll
Syntax
public interface ITestScheduler
Properties
FrameNow
Gets the frame count at this moment. The absolute value does not matter, as long as it is incremented periodically. Used for waiting for frames, and for providing state details for operations.
Declaration
int FrameNow { get; }
Property Value
Type | Description |
---|---|
int | Current frame value. |
TimeNow
Returns the current time. The absolute value does not matter, as long as time progresses monotonically. Used for timeouts, and for providing state details for operations.
Declaration
DateTimeOffset TimeNow { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset | The current time. |
Remarks
This exists mostly so that it can be mocked in internal Responsible tests.
Methods
RegisterPollCallback(Action)
Registers a poll callback to be called at least once per frame. See RetryingPoller for the suggested default strategy. All time and frame based operations run from these callbacks.
Declaration
IDisposable RegisterPollCallback(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Action to call at least once on every frame. |
Returns
Type | Description |
---|---|
IDisposable | A disposable instance, which must unregister the callback when disposed. |