Resolve WES-187 "Unit tests justsign and spellingbee"
This commit is contained in:
committed by
Dries Van Schuylenbergh
parent
1e09f09dae
commit
53fc361af4
@@ -7,6 +7,10 @@ using UnityEngine.TestTools;
|
||||
|
||||
public class SpellingBeeGameEndedPanelTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup for testing scoreboard of Spelling Bee
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
@@ -27,6 +31,10 @@ public class SpellingBeeGameEndedPanelTests
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests the scoreboard for Spelling Bee
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator ScoreTest()
|
||||
{
|
||||
@@ -40,6 +48,9 @@ public class SpellingBeeGameEndedPanelTests
|
||||
|
||||
spellingBeeController.ActivateEnd(true);
|
||||
|
||||
// Fetch the panel with the info for the fields and check if the controller has implemented them
|
||||
var script = GameObject.FindObjectOfType<SpellingBeeGameEndedPanel>();
|
||||
|
||||
SpellingBeeGameEndedPanel SpellingBeeGameEndedPanel = (SpellingBeeGameEndedPanel)GameObject.FindObjectOfType(typeof(SpellingBeeGameEndedPanel));
|
||||
Assert.NotNull(SpellingBeeGameEndedPanel);
|
||||
Assert.AreEqual("Score: 0", SpellingBeeGameEndedPanel.scoreText.text);
|
||||
@@ -49,4 +60,13 @@ public class SpellingBeeGameEndedPanelTests
|
||||
Assert.AreEqual("00:01", SpellingBeeGameEndedPanel.timeText.text);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup after testing
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void TearDown_SpellingBeeScoreTests()
|
||||
{
|
||||
PersistentDataController.PATH = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user