51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using NUnit.Framework;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Test the Theme class
|
|
/// </summary>
|
|
[TestFixture]
|
|
public class ThemeTests
|
|
{
|
|
/// <summary>
|
|
/// Reference to the current theme, for quick access
|
|
/// </summary>
|
|
private Theme theme;
|
|
|
|
/// <summary>
|
|
/// The names of custom learnables for a custom theme
|
|
/// </summary>
|
|
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);
|
|
}
|
|
}
|