Пример #1
0
        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;
        }
Пример #2
0
        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;
        }
Пример #3
0
        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;
        }
Пример #4
0
        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;
        }
Пример #5
0
        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);
        }