Ejemplo n.º 1
0
        public void ExpectAfterExectueToDelegateCallToCurrentState()
        {
            var player = new Mock<IPlayer>();
            var state1 = new Mock<ITurnState>();
            var provider = new Mock<IStateProvider>();
            provider.Setup(p => p.HasNext()).Returns(true);
            provider.Setup(p => p.GetNext()).Returns(state1.Object);

            var turn = new Turn(player.Object, provider.Object);
            turn.NextFlowState();
            turn.AfterExecute(GameCommand.RollDice);

            state1.Verify(s => s.AfterExecute(GameCommand.RollDice));
        }