public void Does_not_deactivate_behaviour_when_authority_is_not_lost() { ActivationManager.AddComponent(PositionComponentId); ActivationManager.ChangeAuthority(PositionComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TestBehaviourWithReader>().enabled, "Behaviour should not be disabled if authority is not lost"); }
public void Does_not_deactivate_behaviour_when_authority_is_not_lost() { ActivationManager.AddComponent(ComponentId); ActivationManager.ChangeAuthority(ComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TBehaviour>().enabled, "Behaviour should not be disabled if authority is not lost"); ValidateRequirablesNotNull(); }
public void Activates_behaviour_when_authority_is_present() { ActivationManager.AddComponent(PositionComponentId); ActivationManager.ChangeAuthority(PositionComponentId, Authority.Authoritative); Assert.IsFalse(TestGameObject.GetComponent <TestBehaviourWithReader>().enabled, "Behaviour should not be enabled before EnableSpatialOSBehaviours is called even if authority is gained"); ActivationManager.EnableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TestBehaviourWithReader>().enabled, "Behaviour should be enabled after EnableSpatialOSBehaviours is called"); }
public void Activates_behaviour_when_authority_is_present() { ActivationManager.AddComponent(ComponentId); ActivationManager.ChangeAuthority(ComponentId, Authority.Authoritative); Assert.IsFalse(TestGameObject.GetComponent <TBehaviour>().enabled, "Behaviour should not be enabled before EnableSpatialOSBehaviours is called"); ActivationManager.EnableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TBehaviour>().enabled, "Behaviour should be enabled after EnableSpatialOSBehaviours is called"); ValidateRequirablesNotNull(); }
public void Does_not_deactivate_behaviour_when_authority_is_lost() { ActivationManager.AddComponent(ComponentId); ActivationManager.ChangeAuthority(ComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.ChangeAuthority(ComponentId, Authority.NotAuthoritative); Assert.IsTrue(TestGameObject.GetComponent <TestBehaviourWithCommandSender>().enabled, "Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " even if authority is lost"); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <TestBehaviourWithCommandSender>().enabled, "Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " even if authority is lost"); AssertRequirablesNotNull(); }
public void Does_not_deactivate_reader_behaviour_when_authority_is_lost() { ActivationManager.AddComponent(PositionComponentId); ActivationManager.ChangeAuthority(PositionComponentId, Authority.Authoritative); ActivationManager.EnableSpatialOSBehaviours(); ActivationManager.ChangeAuthority(PositionComponentId, Authority.NotAuthoritative); Assert.IsTrue(TestGameObject.GetComponent <ReaderBehaviour>().enabled, "Reader Behaviour should not be disabled before DisableSpatialOSBehaviours is called" + " even if authority is lost"); Assert.IsTrue(TestGameObject.GetComponent <WriterBehaviour>().enabled, "Writer Behaviour should not be disabled before DisableSpatialOSBehaviours is called" + " even if authority is lost"); ActivationManager.DisableSpatialOSBehaviours(); Assert.IsTrue(TestGameObject.GetComponent <ReaderBehaviour>().enabled, "Reader Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " even if authority is lost"); Assert.IsFalse(TestGameObject.GetComponent <WriterBehaviour>().enabled, "Writer Behaviour should not be disabled after DisableSpatialOSBehaviours is called" + " after authority is lost"); }