public IEnumerator TestAddAndRemoveAllStates() { // Create an interactive cube InteractiveElement interactiveElement = CreateInteractiveCube(); yield return(null); string[] coreStates = Enum.GetNames(typeof(CoreInteractionState)).ToArray(); foreach (string coreStateName in coreStates) { // The Default and Focus states are present by default if (coreStateName != defaultStateName && coreStateName != focusStateName) { interactiveElement.AddNewState(coreStateName); yield return(null); } } foreach (string coreStateName in coreStates) { Assert.IsNotNull(interactiveElement.GetState(coreStateName), $"The {coreStateName} state is null after it was added."); yield return(null); } foreach (string coreStateName in coreStates) { if (coreStateName != defaultStateName) { interactiveElement.RemoveState(coreStateName); yield return(null); } } foreach (string coreStateName in coreStates) { if (coreStateName != defaultStateName) { Assert.IsNull(interactiveElement.GetState(coreStateName), $"The {coreStateName} state is not null after it was removed."); yield return(null); } } yield return(null); }