public IEnumerator AutoCompleteActive() { // Given a touched condition, GameObject obj = new GameObject("T1"); TouchablePropertyMock mockedProperty = obj.AddComponent <TouchablePropertyMock>(); yield return(new WaitForFixedUpdate()); TouchedCondition condition = new TouchedCondition(mockedProperty); bool wasTouched = false; bool wasUntouched = false; mockedProperty.Touched += (sender, args) => { wasTouched = true; mockedProperty.Untouched += (unsender, unargs) => wasUntouched = true; }; // When you activate and autocomplete it, condition.LifeCycle.Activate(); while (condition.LifeCycle.Stage != Stage.Active) { yield return(null); condition.Update(); } condition.Autocomplete(); // Then it is completed. Assert.AreEqual(Stage.Active, condition.LifeCycle.Stage); Assert.IsTrue(wasTouched); Assert.IsTrue(wasUntouched); }