Michael
ad725ee518
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Some general refactors: Turns HeroPartySO into a runtime set class. Make runtime set an IEnumerable Simplify name of events Reviewed-on: #17 Reviewed-by: zephyr <zephyr@noreply.localhost> Co-authored-by: Michael <mep053@gmail.com> Co-committed-by: Michael <mep053@gmail.com>
23 lines
630 B
C#
23 lines
630 B
C#
using System.Collections;
|
|
using NUnit.Framework;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using UnityEngine.TestTools;
|
|
|
|
public class HeroPartyTest
|
|
{
|
|
[UnityTest]
|
|
public IEnumerator HeroPartyGetsAllTheHeroes()
|
|
{
|
|
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>("Assets/Prefabs/Hero.prefab");
|
|
Assert.IsNotNull(prefab);
|
|
var instance = Object.Instantiate(prefab);
|
|
var hero = instance.GetComponent<HeroUnit>();
|
|
yield return null;
|
|
Assert.AreEqual(1, hero.party.Count);
|
|
Object.Destroy(instance);
|
|
yield return null;
|
|
Assert.IsEmpty(hero.party);
|
|
}
|
|
}
|