コード例 #1
0
        public void ErrantEnd()
        {
            var group = new TestStateGroup();
            var state = new TestState();

            group.Entry = state;

            group.Start();
            group.Update();
            group.End();
            group.End();

            Assert.AreEqual(1, state.EndIterations);
        }
コード例 #2
0
        public void SubstateLifecycleRestart()
        {
            var group = new TestStateGroup();
            var state = new TestState();

            group.Entry = state;

            group.Start();
            group.Update();
            group.End();
            group.Start();
            group.Update();
            group.End();

            Assert.AreEqual(2, state.StartIterations);
            Assert.AreEqual(2, state.UpdateIterations);
            Assert.AreEqual(2, state.EndIterations);
        }
コード例 #3
0
        public void EndWithoutStart()
        {
            var group = new TestStateGroup();
            var state = new TestState();

            group.Entry = state;

            group.End();

            Assert.AreEqual(0, state.StartIterations);
            Assert.AreEqual(0, state.UpdateIterations);
            Assert.AreEqual(0, state.EndIterations);
        }
コード例 #4
0
        public void LifecycleEvents()
        {
            var group = new TestStateGroup();
            var state = new TestState();

            group.Entry = state;

            group.Start();
            group.Update();
            group.End();

            Assert.AreEqual(1, group.StartIterations);
            Assert.AreEqual(1, state.UpdateIterations);
            Assert.AreEqual(1, group.EndIterations);
        }