Question by
DomLennonZa · Jul 22, 2019 at 08:36 PM ·
testingtest
Unity TestRunner doesnt show tests as "Run"
Hi,
I have written some playmode tests that seem to be working fine, except for the fact that it always shows the state of the tests as "Didnt run". If the assert fails, it just kills the test right there with no message bubbling up. If all asserts pass, the test just closes with no errors.
Here is a snippet of one of my tests:
[UnityTest]
public IEnumerator WhenPathingThroughUnlockedDoor_WithLocksmith_CreatesOpenInteraction()
{
// Arrange
yield return LoadLevel("Integration_LS_Doors");
var block = Services.Pathing.GetBlockAtPosition(new Vector3(2.3f, 0f, 1.7f));
Services.LevelController.CurrentMember.CreateAction(block, ActionType.Move);
// Act
UnityEngine.Assertions.Assert.IsTrue(Services.LevelController.CurrentMember.Actions.Any(a => a.Interaction.GetType() == typeof(OpenDoorInteraction)));
Services.LevelController.GameState = GameState.Execution;
yield return WaitForAllActions();
// Assert
UnityEngine.Assertions.Assert.IsTrue(GameObject.FindObjectOfType<DoorBehaviour>().IsOpen);
}
Please let me know if there is anything else I can post that will be helpful.
Thanks,
Comment