public IEnumerator RefusesDifferent() { containingObject.AddComponent <Light>(); SerializableTypeBehaviourObservableList behaviourTypes = containingObject.AddComponent <SerializableTypeBehaviourObservableList>(); yield return(null); subject.BehaviourTypes = behaviourTypes; behaviourTypes.Add(typeof(TestScript)); Assert.IsFalse(container.Accepts(containingObject)); }
public IEnumerator RefuseDisabledBehaviour() { TestScript testScript = containingObject.AddComponent <TestScript>(); SerializableTypeBehaviourObservableList behaviourTypes = containingObject.AddComponent <SerializableTypeBehaviourObservableList>(); yield return(null); subject.BehaviourTypes = behaviourTypes; behaviourTypes.Add(typeof(TestScript)); testScript.enabled = false; Assert.IsFalse(container.Accepts(containingObject)); }
public IEnumerator RefusesInactiveGameObject() { TestScript testScript = containingObject.AddComponent <TestScript>(); SerializableTypeBehaviourObservableList behaviourTypes = containingObject.AddComponent <SerializableTypeBehaviourObservableList>(); yield return(null); subject.BehaviourTypes = behaviourTypes; behaviourTypes.Add(typeof(TestScript)); testScript.enabled = true; subject.gameObject.SetActive(false); Assert.IsFalse(container.Accepts(containingObject)); }
public IEnumerator AcceptsInactiveComponent() { TestScript testScript = containingObject.AddComponent <TestScript>(); SerializableTypeBehaviourObservableList behaviourTypes = containingObject.AddComponent <SerializableTypeBehaviourObservableList>(); yield return(null); subject.BehaviourTypes = behaviourTypes; behaviourTypes.Add(typeof(TestScript)); testScript.enabled = true; subject.AutoRejectStates = BaseRule.RejectRuleStates.RuleGameObjectIsNotActiveInHierarchy; subject.enabled = false; Assert.IsTrue(container.Accepts(containingObject)); subject.gameObject.SetActive(false); Assert.IsFalse(container.Accepts(containingObject)); }