Class UnityTestScheduler
Default ITestScheduler implementation for Unity.
Will call polling methods in Update
.
Inheritance
Namespace: Responsible.Unity
Assembly: Responsible.dll
Syntax
public class UnityTestScheduler : MonoBehaviour, ITestScheduler, IDisposable
Remarks
If you want to customize this behaviour, it is recommended to just implement your own custom implementation, instead of reusing this one. However, if you want to compose a custom TestInstructionExecutor for Unity, using this as a scheduler is recommended.
Methods
Create()
Creates a UnityTestScheduler in a DontDestroyOnLoad GameObject. The GameObject will be destroyed when this instance is disposed.
Declaration
public static UnityTestScheduler Create()
Returns
Type | Description |
---|---|
UnityTestScheduler |
Dispose()
Will destroy the GameObject this instance is running on.
Declaration
public void Dispose()
Explicit Interface Implementations
ITestScheduler.FrameNow
Returns the current Unity frame number.
Declaration
int ITestScheduler.FrameNow { get; }
Returns
Type | Description |
---|---|
Int32 | The current Unity frame number. |
ITestScheduler.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 ITestScheduler.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. |
ITestScheduler.TimeNow
Returns the system time using DateTimeOffset.Now.
Declaration
DateTimeOffset ITestScheduler.TimeNow { get; }
Returns
Type | Description |
---|---|
DateTimeOffset |