public IEnumerator InventoryUIControllerOnInventoryCloseTest() { game = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Game")); inventory = GameObject.FindObjectOfType <InventoryUIController>(); yield return(new WaitForSecondsRealtime(1f)); inventory.OnInventoryOpen(); yield return(new WaitForSecondsRealtime(1f)); inventory.OnInventoryClose(); yield return(new WaitForSecondsRealtime(1f)); Assert.IsFalse(inventory.isActiveAndEnabled); }