예제 #1
0
        public void ShouldSpawnObjectsOnEntry()
        {
            var state = new FadeOutState(gameManagerMock.Object, true);

            state.OnEntry();
            gameManagerMock.Verify(foo => foo.FadeOut());
        }
예제 #2
0
        public void ShouldTransitionOnAfterAWhile()
        {
            var state = new FadeOutState(gameManagerMock.Object, true);

            state.OnEntry();
            timeProviderMock.Setup(foo => foo.Time).Returns(0);
            for (int i = 0; i < 10; i++)
            {
                // Just run a bunch to show it's not transitioning
                Assert.IsNull(state.OnDuring());
            }
            timeProviderMock.Setup(foo => foo.Time).Returns(FadeOutState.fadeoutTime + 1);

            Assert.IsTrue(state.OnDuring() is UpdatePointsState);
        }