idle-survivors/Assets/TestsPlaymode/HeroPartyTest.cs
zephyr f70aa57166
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
party (#15)
Resolves #6.
Updates #3.

Co-authored-by: Branden J Brown <zephyrtronium@gmail.com>
Reviewed-on: #15
Reviewed-by: madxmike <madxmike@noreply.localhost>
2023-08-09 21:40:32 -04:00

24 lines
673 B
C#

using System.Collections;
using System.Collections.Generic;
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.UnitList);
}
}