using System.Collections; using NUnit.Framework; using UnityEditor; using UnityEngine; using UnityEngine.TestTools; public class HeroPartyTest { [UnityTest] public IEnumerator HeroPartyGetsAllTheHeroes() { var prefab = AssetDatabase.LoadAssetAtPath("Assets/Prefabs/Hero.prefab"); Assert.IsNotNull(prefab); var instance = Object.Instantiate(prefab); var hero = instance.GetComponent(); yield return null; Assert.AreEqual(1, hero.party.Count); Object.Destroy(instance); yield return null; Assert.IsEmpty(hero.party); } }