// Test for drawing on the canvas and update percentage public IEnumerator testDrawOnTheCanvas() { DrawCanvas drawCanvas = GameObject.Find("Cover").GetComponent <DrawCanvas> (); Assert.AreNotEqual("Scan Complete!", drawCanvas.textPercent.text); for (float i = -2.3f; i < 1.4f; i += 0.4f) { for (float j = 1.6f; j > -2f; j -= 0.4f) { drawCanvas.BrushPlace(new Vector2(i, j)); yield return(new WaitForSecondsRealtime(0.05f)); drawCanvas.Invoke("UpdatePercent", 0); } } Assert.AreEqual("Scan Complete!", drawCanvas.textPercent.text); // When game is completed, textPercentage shows "Scan Complete!" yield return(null); }