public IEnumerator FastForwardInactiveNonBlockingBehavior() { // Given a non-blocking behavior, EndlessBehaviorMock behaviorMock = new EndlessBehaviorMock(false); behaviorMock.Configure(RuntimeConfigurator.Configuration.Modes.CurrentMode); // When we mark it to fast-forward, behaviorMock.LifeCycle.MarkToFastForward(); // Then it doesn't autocomplete because it hasn't been activated yet. Assert.AreEqual(Stage.Inactive, behaviorMock.LifeCycle.Stage); yield break; }
public IEnumerator BlockingBehaviorActivating() { // Given a blocking behavior, EndlessBehaviorMock behaviorMock = new EndlessBehaviorMock(true); behaviorMock.Configure(RuntimeConfigurator.Configuration.Modes.CurrentMode); // When we activate it, behaviorMock.LifeCycle.Activate(); // Then it is immediately activating. Assert.AreEqual(Stage.Activating, behaviorMock.LifeCycle.Stage); yield break; }
public IEnumerator NonBlockingBehaviorActivating() { // Given a non-blocking behavior, EndlessBehaviorMock behaviorMock = new EndlessBehaviorMock(false); behaviorMock.Configure(RuntimeConfigurator.Configuration.Modes.CurrentMode); // When we activate it, behaviorMock.LifeCycle.Activate(); // Then behavior starts its activation. Assert.AreEqual(Stage.Activating, behaviorMock.LifeCycle.Stage); yield break; }
public IEnumerator FastForwardInactiveNonBlockingBehaviorAndActivateIt() { // Given a non-blocking behavior, EndlessBehaviorMock behaviorMock = new EndlessBehaviorMock(false); behaviorMock.Configure(RuntimeConfigurator.Configuration.Modes.CurrentMode); // When we mark it to fast-forward and activate it, behaviorMock.LifeCycle.MarkToFastForward(); behaviorMock.LifeCycle.Activate(); // Then the behavior should be activated immediately. Assert.AreEqual(Stage.Active, behaviorMock.LifeCycle.Stage); yield break; }
public IEnumerator NonBlockingBehaviorActivated() { // Given a non-blocking behavior, EndlessBehaviorMock behaviorMock = new EndlessBehaviorMock(false); behaviorMock.Configure(RuntimeConfigurator.Configuration.Modes.CurrentMode); // When we activate and finish activation, behaviorMock.LifeCycle.Activate(); behaviorMock.LifeCycle.MarkToFastForward(); yield return(null); behaviorMock.Update(); yield return(null); behaviorMock.Update(); // Then it is activated. Assert.AreEqual(Stage.Active, behaviorMock.LifeCycle.Stage); }