Resolve WES-187 "Unit tests account and system"
This commit is contained in:
committed by
Jerome Coudron
parent
c4b6c60288
commit
b9bbef8dcf
48
Assets/Architecture/Tests/EditMode/SystemControllerTests.cs
Normal file
48
Assets/Architecture/Tests/EditMode/SystemControllerTests.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using NUnit.Framework;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Test the SystemController class
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class SystemControllerTests
|
||||
{
|
||||
[Test]
|
||||
public void Test_SystemController_GetInstance()
|
||||
{
|
||||
Assert.IsNotNull(SystemController.GetInstance());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_GetSceneIndex_InvalidScene()
|
||||
{
|
||||
Assert.AreEqual(-1, SystemController.GetSceneIndex("a/non/existing/scene"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_GetSceneIndex_ValidScene()
|
||||
{
|
||||
List<string> scenes = new List<string>()
|
||||
{
|
||||
"Common/Scenes/Boot",
|
||||
"Common/Scenes/MainMenuScreen",
|
||||
"Common/Scenes/CoursesMenuScreen",
|
||||
"Common/Scenes/ListCoursesScreen",
|
||||
"Common/Scenes/ListMinigamesScreen",
|
||||
"Common/Scenes/CourseActivityScreen",
|
||||
"Common/Scenes/MinigameActivityScreen",
|
||||
"Common/Scenes/ThemeSelectionScreen",
|
||||
"Common/Scenes/SettingsScreen",
|
||||
"Accounts/Scenes/UserCreationScreen",
|
||||
"Accounts/Scenes/ChangeUserScreen",
|
||||
"Accounts/Scenes/UserProgressScreen",
|
||||
"Courses/Scenes/CourseScreen",
|
||||
"SpellingBee/Scenes/SpellingBeeGame",
|
||||
"Hangman/Scenes/HangmanGame",
|
||||
"JustSign/Scenes/JustSignGame",
|
||||
};
|
||||
Assert.AreEqual(SceneManager.sceneCountInBuildSettings, scenes.Count);
|
||||
// Testing wether the names and indices are correct needs to be done in PlayMode
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user