Namespace Responsible.Unity
Contains classes which are Unity specific, and only available on Unity builds.
The main classes to use are
UnityTestInstructionExecutor,
which sets up a default test instruction executor for Unity,
and TestOperationYieldInstruction<T>,
which can be yielded from [UnityTest]
methods.
Classes
TestOperationYieldInstruction<T>
A UnityEngine.CustomYieldInstruction that can be yielded from a
[UnityTest]
playmode test.
UnhandledLogMessageException
Exception type which is used when an unhandled log message is detected during test operation execution.
UnityErrorLogInterceptor
Class used to replicate the Unity test runner behaviour of failing tests when either LogError(object) or LogException(Exception) is called.
UnityFailureListener
Provides default IFailureListener functionality for Unity, by logging failures. Unity doesn't handle exceptions in coroutines very well in tests (one of the motivations to write Responsible), so we also log failures to ensure they are visible.
UnityTestInstructionExecutor
A TestInstructionExecutor implementation that should work well in Unity:
- Polls on every frame
- Causes test operations to fail on logged errors
- Can also log failures, as Unity will swallow exceptions in nested coroutines
UnityTestScheduler
Default ITestScheduler implementation for Unity.
Will call polling methods in Update
.