Esempio n. 1
0
        public void AddActionStateCondition_DoesNotCallStartIfNotOnRunningTrack()
        {
            var conditionRunner = new ActionStateConditionRunner();

            var condition = new TestActionStateCondition();

            conditionRunner.PushNewTrack();
            conditionRunner.AddCondition(condition);

            Assert.IsFalse(condition.StartCalled);
        }
Esempio n. 2
0
        public void Update_CallsStartOnConditionsOnceTheirTrackIsRunning()
        {
            var conditionRunner = new ActionStateConditionRunner();

            var firstCondition  = new TestActionStateCondition();
            var secondCondition = new TestActionStateCondition();

            conditionRunner.AddCondition(firstCondition);
            conditionRunner.PushNewTrack();
            conditionRunner.AddCondition(secondCondition);
            firstCondition.ForceComplete();
            conditionRunner.Update(1.0f);
            conditionRunner.Update(1.0f);

            Assert.IsTrue(secondCondition.StartCalled);
        }
Esempio n. 3
0
        public void PushNewTrack_DoesNotUpdateNewTrackUntilPriorComplete()
        {
            var conditionRunner = new ActionStateConditionRunner();

            var firstCondition  = new TestActionStateCondition();
            var secondCondition = new TestActionStateCondition();

            conditionRunner.AddCondition(firstCondition);
            conditionRunner.PushNewTrack();
            conditionRunner.AddCondition(secondCondition);
            firstCondition.ForceComplete();
            secondCondition.ForceComplete();

            conditionRunner.Update(1.0f);

            Assert.IsFalse(conditionRunner.IsComplete());
        }
Esempio n. 4
0
        public void PushNewTrack_UpdateAfterPriorCompletesTrack()
        {
            var conditionRunner = new ActionStateConditionRunner();

            var firstCondition  = new TestActionStateCondition();
            var secondCondition = new TestActionStateCondition();

            conditionRunner.AddCondition(firstCondition);
            conditionRunner.PushNewTrack();
            conditionRunner.AddCondition(secondCondition);
            firstCondition.ForceComplete();
            secondCondition.ForceComplete();

            conditionRunner.Update(1.0f);
            conditionRunner.Update(1.0f);

            Assert.IsTrue(conditionRunner.IsComplete());
        }