Class MonoBehaviourTest<T>
This is a wrapper that allows running tests on MonoBehaviour scripts. Inherits from CustomYieldInstruction MonoBehaviourTest is a coroutine and a helper for writing MonoBehaviour tests.
Yield a MonoBehaviourTest when using the UnityTest attribute to instantiate the MonoBehaviour you wish to test and wait for it to finish running. Implement the IMonoBehaviourTest interface on the MonoBehaviour to state when the test completes.
Implements
Inherited Members
Namespace: UnityEngine.TestTools
Assembly: solution.dll
Syntax
public class MonoBehaviourTest<T> : CustomYieldInstruction, IEnumerator where T : MonoBehaviour, IMonoBehaviourTest
Type Parameters
| Name | Description |
|---|---|
| T | A MonoBehaviour component created for the test and attached to the tests GameObject. |
Constructors
| Name | Description |
|---|---|
| MonoBehaviourTest(bool) | Initializes and returns an instance of MonoBehaviourTest. |
Properties
| Name | Description |
|---|---|
| component | A MonoBehaviour component created for the test and attached to the test's GameObject. |
| gameObject | A |
| keepWaiting | (Inherited) Returns `true`` if the test is not finished yet, which keeps the coroutine suspended |