Methods marked with the [UnityTest] attribute are run as coroutines. A coroutine has the ability to pause execution (when it meets a yield statement) and return control to Unity, but then to continue where it left off when called again (for example, the next frame, second frame, and so on). The yield statement indicates the statement after which, and for how long, execution of the method is to be paused. Examples of different types of yield include the following:
- Waiting until the next frame: null
- Waiting for a given length of time: WaitForSeconds(<seconds>)
- Waiting until the next fixed-update time period (physics is not applied to each frame (since the framerate varies) but after a fixed period of time): WaitForFixedUpdate()
The GameObject_WithRigidBody_WillBeAffectedByPhysics() method creates a new GameObject and attaches to it a Rigidbody. It also stores the original Y position. The yield statement makes PlayMode Test Runner wait until physics has...