public IAssertionResult WarningInTheScene() { IAssertionResult result = null; if (this.WarningTextObject == null) { result = new AssertionResultRetry("No warning on the scene"); } else if (!this.WarningTextObject.activeSelf) { result = new AssertionResultRetry("No visible warning on the scene"); } else { Text text = this.WarningTextObject.GetComponent <Text>(); if (text.text.Equals(this.ExpectedWarningText)) { result = new AssertionResultSuccessful(); } else { result = new AssertionResultFailed("The warning message has not the expected text: \"" + text.text + "\" instead of \"" + this.ExpectedWarningText); } } return(result); }
public IAssertionResult TheNewObjectAppears() { IAssertionResult result = null; GameObject cube = GameObject.FindWithTag(CubeTag); if (cube == null || !cube.name.Equals(CubeName)) { result = new AssertionResultRetry("\"" + CubeName + "\" not found"); } else if (cube != null && cube.activeSelf) { result = new AssertionResultSuccessful(); } return(result); }
public IAssertionResult TheCubeDisappears() { IAssertionResult result = null; GameObject cube = GameObject.FindWithTag(CubeTag); if (cube != null && cube.activeSelf) { result = new AssertionResultRetry("\"object for test\" found and Active"); } else if (cube != null) { result = new AssertionResultRetry("\"object for test\" found inactive"); } else { result = new AssertionResultSuccessful(); } return(result); }
public IAssertionResult StartedAndWaitingForInput() { IAssertionResult result = null; GameObject cube = GameObject.FindWithTag(CubeTag); GameObject buttonCreate = GameObject.FindWithTag(ButtonCreateTag); if (buttonCreate == null) { result = new AssertionResultRetry("Button Create not found"); } else if (cube != null) { result = new AssertionResultFailed("There is an unexpected cube in the scene."); } else if (buttonCreate != null && buttonCreate.activeSelf) { result = new AssertionResultSuccessful(); } return(result); }