Files
unity-application/Assets/Common/Tests/ThemeTest.cs
Jelle De Geest c6faf3bf6f Sprint 3
2023-03-26 21:23:17 +00:00

41 lines
1.1 KiB
C#

using NUnit.Framework;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Test the Theme class
/// </summary>
[TestFixture]
public class ThemeTest
{
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);
}
}