Resolve WES-187 "Unit tests account and system"

This commit is contained in:
Dries Van Schuylenbergh
2023-04-30 15:51:41 +00:00
committed by Jerome Coudron
parent c4b6c60288
commit b9bbef8dcf
143 changed files with 2008 additions and 542 deletions

View File

@@ -0,0 +1,41 @@
using NUnit.Framework;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Test the Theme class
/// </summary>
[TestFixture]
public class ThemeTests
{
private Theme theme;
private List<string> names = new List<string>() { "appel", "peer", "banaan" };
/// <summary>
/// Setup a theme with some learnables in it
/// </summary>
[SetUp]
public void Setup()
{
theme = ScriptableObject.CreateInstance<Theme>();
foreach (string name in names)
{
Learnable learnable = new Learnable();
learnable.name = name;
theme.learnables.Add(learnable);
}
}
/// <summary>
/// Test if all the learnables are stored in the theme
/// </summary>
[Test]
public void TestThemeLearnables()
{
// Check if each of the learnables is kept
foreach (Learnable learnable in theme.learnables)
{
names.Remove(learnable.name);
}
// Assert that all items have been checked
Assert.IsTrue(names.Count == 0);
}
}