Resolve WES-181 "Missing code doc"
This commit is contained in:
committed by
Louis Adriaens
parent
7505ae7262
commit
3d99184717
@@ -5,12 +5,14 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
/// <summary>
|
||||
/// Test the BackButton class
|
||||
/// </summary>
|
||||
public class BackButtonTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
@@ -39,12 +41,11 @@ public class BackButtonTests
|
||||
/// <summary>
|
||||
/// Tests returning to the previous screen with the backbutton
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator BackTest()
|
||||
{
|
||||
|
||||
var backButton = GameObject.FindObjectOfType<BackButton> ();
|
||||
var backButton = GameObject.FindObjectOfType<BackButton>();
|
||||
backButton.Back();
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@ using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
|
||||
public class StartGamesTests
|
||||
/// <summary>
|
||||
/// Test the BootScreen class
|
||||
/// </summary>
|
||||
public class BootScreenTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator BootWithUsersTest()
|
||||
{
|
||||
@@ -44,6 +45,7 @@ public class StartGamesTests
|
||||
}
|
||||
Assert.IsNull(userCreationScreen);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup after testing
|
||||
/// </summary>
|
||||
@@ -56,7 +58,6 @@ public class StartGamesTests
|
||||
/// <summary>
|
||||
/// Test booting without user
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator BootWithoutUsersTest()
|
||||
{
|
||||
@@ -88,5 +89,4 @@ public class StartGamesTests
|
||||
}
|
||||
Assert.IsNull(mainMenuScreen);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,12 +5,14 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
public class CourseActivityTests
|
||||
/// <summary>
|
||||
/// Test the CourseActivityScreen class
|
||||
/// </summary>
|
||||
public class CourseActivityScreenTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
@@ -33,10 +35,10 @@ public class CourseActivityTests
|
||||
{
|
||||
PersistentDataController.PATH = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Full tests of the CoursesActivityScreen
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator CoursesActivityTest()
|
||||
{
|
||||
@@ -1,14 +1,20 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.TestTools;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Test the CourseItem class
|
||||
/// </summary>
|
||||
public class CourseItemTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
|
||||
@@ -5,12 +5,14 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
/// <summary>
|
||||
/// Test the CourseMenuScreen class
|
||||
/// </summary>
|
||||
public class CourseMenuScreenTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,9 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
/// <summary>
|
||||
/// Test the ListCoursesScreen class
|
||||
/// </summary>
|
||||
public class ListCoursesScreenTests
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -5,6 +5,9 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
/// <summary>
|
||||
/// Test the ListMinigamesScreen class
|
||||
/// </summary>
|
||||
public class ListMinigamesScreenTests
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,9 @@ using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the MainMenuScreen class
|
||||
/// </summary>
|
||||
public class MainMenuScreenTests
|
||||
{
|
||||
/// <summary>
|
||||
@@ -112,6 +114,7 @@ public class MainMenuScreenTests
|
||||
Assert.IsNotNull(backbutton);
|
||||
backbutton.GetComponent<UnityEngine.UI.Button>().onClick.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests the QuicApplication function of the MainMenuScreen
|
||||
/// </summary>
|
||||
@@ -121,6 +124,5 @@ public class MainMenuScreenTests
|
||||
var mainMenuScreen = GameObject.FindObjectOfType<MainMenuScreen>();
|
||||
mainMenuScreen.QuitApplication();
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,14 @@ using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
|
||||
public class MiniGameActivityScreenTests
|
||||
/// <summary>
|
||||
/// Test the MinigameActivityScreen class
|
||||
/// </summary>
|
||||
public class MinigameActivityScreenTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
@@ -25,6 +26,7 @@ public class MiniGameActivityScreenTests
|
||||
SystemController.GetInstance().LoadNextScene("Common/Scenes/ListMinigamesScreen");
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup after testing
|
||||
/// </summary>
|
||||
@@ -37,7 +39,6 @@ public class MiniGameActivityScreenTests
|
||||
/// <summary>
|
||||
/// Test loading the spellingbee minigame
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator GotoSpellingBeeTest()
|
||||
{
|
||||
@@ -45,12 +46,11 @@ public class MiniGameActivityScreenTests
|
||||
listMinigamesScreen.minigameList.SetCurrentMinigame(MinigameIndex.SPELLING_BEE);
|
||||
listMinigamesScreen.LoadScene("Common/Scenes/MinigameActivityScreen");
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test loading the Hangman minigame
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator GotoHangmanTest()
|
||||
{
|
||||
@@ -58,12 +58,11 @@ public class MiniGameActivityScreenTests
|
||||
listMinigamesScreen.minigameList.SetCurrentMinigame(MinigameIndex.HANGMAN);
|
||||
listMinigamesScreen.LoadScene("Common/Scenes/MinigameActivityScreen");
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test loading the JustSign minigame
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator GotoJustSignTest()
|
||||
{
|
||||
@@ -71,20 +70,18 @@ public class MiniGameActivityScreenTests
|
||||
listMinigamesScreen.minigameList.SetCurrentMinigame(MinigameIndex.JUST_SIGN);
|
||||
listMinigamesScreen.LoadScene("Common/Scenes/MinigameActivityScreen");
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if Progress is loading correctly
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator ProgressLoadTest()
|
||||
{
|
||||
string path = $"{Application.persistentDataPath}/wesign_unit_test.json";
|
||||
string minigame = "{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}],\"highestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}]}";
|
||||
string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}";
|
||||
|
||||
|
||||
File.WriteAllText(path, oneUser);
|
||||
PersistentDataController.PATH = path;
|
||||
PersistentDataController.GetInstance().Load();
|
||||
@@ -96,8 +93,6 @@ public class MiniGameActivityScreenTests
|
||||
listMinigamesScreen.minigameList.SetCurrentMinigame(MinigameIndex.HANGMAN);
|
||||
listMinigamesScreen.LoadScene("Common/Scenes/MinigameActivityScreen");
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.TestTools;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Test the MinigameItem class
|
||||
/// </summary>
|
||||
public class MinigameItemTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
@@ -26,6 +28,7 @@ public class MinigameItemTests
|
||||
SystemController.GetInstance().LoadNextScene("Common/Scenes/ListMinigamesScreen");
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup after testing
|
||||
/// </summary>
|
||||
@@ -38,7 +41,6 @@ public class MinigameItemTests
|
||||
/// <summary>
|
||||
/// Test the callback function of a MinigameItem
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator CallBackTest()
|
||||
{
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.TestTools;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Test the ThemeItem class
|
||||
/// </summary>
|
||||
public class ThemeItemTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
@@ -26,6 +28,7 @@ public class ThemeItemTests
|
||||
SystemController.GetInstance().LoadNextScene("Common/Scenes/ListMinigamesScreen");
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cleanup after testing
|
||||
/// </summary>
|
||||
@@ -34,10 +37,10 @@ public class ThemeItemTests
|
||||
{
|
||||
PersistentDataController.PATH = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the callback function of a ThemeItem
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator CallBackTest()
|
||||
{
|
||||
@@ -58,6 +61,6 @@ public class ThemeItemTests
|
||||
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
|
||||
Assert.AreEqual("SpellingBeeGame", SceneManager.GetActiveScene().name);
|
||||
Assert.AreEqual("SpellingBeeGame", SceneManager.GetActiveScene().name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
using UnityEditor;
|
||||
using NUnit.Framework;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
using NUnit.Framework;
|
||||
|
||||
/// <summary>
|
||||
/// Test the UserButton class
|
||||
/// </summary>
|
||||
public class UserButtonTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Setup the environment before each test
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnitySetUp]
|
||||
public IEnumerator SetupFunction()
|
||||
{
|
||||
@@ -37,7 +39,6 @@ public class UserButtonTests
|
||||
/// <summary>
|
||||
/// Test the ChangeUserCallback on the UserButton
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator ChangeUserCallbackTest()
|
||||
{
|
||||
@@ -52,7 +53,6 @@ public class UserButtonTests
|
||||
/// <summary>
|
||||
/// Test if the username and avatar are correctly loaded
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator CorrectUsernameAndAvatarTest()
|
||||
{
|
||||
@@ -63,10 +63,10 @@ public class UserButtonTests
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the transition to UserProgressScreen
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator ChangeSceneToUserProgressScreenTest()
|
||||
{
|
||||
@@ -78,10 +78,10 @@ public class UserButtonTests
|
||||
var userProgressScreen = GameObject.FindObjectOfType<UserProgressScreen>();
|
||||
Assert.IsNotNull(userProgressScreen, "Scene was not correctly changed to UserProgressScreen.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test is the user dropdown menu works correctly
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[UnityTest]
|
||||
public IEnumerator ToggleDropdownTest()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user