コード例 #1
0
ファイル: RollStateTest.cs プロジェクト: Corne/VOC
        public void ExpectSetStateRobberIfDiceResult7()
        {
            var dice = CreateDice(7);
            var turn = new Mock<IGameTurn>();
            var state = new RollState(turn.Object, dice);
            state.AfterExecute(GameCommand.RollDice);

            turn.Verify(t => t.NextFlowState(), Times.Never);
            turn.Verify(t => t.SetState<RobberDiscardState>(), Times.Once);
        }
コード例 #2
0
ファイル: RollStateTest.cs プロジェクト: Corne/VOC
        public void ExpectNothingToHappenIfStateNotStarted()
        {
            var dice = CreateDice(5);
            var turn = new Mock<IGameTurn>();

            var state = new RollState(turn.Object, dice);

            dice.Roll();

            turn.Verify(t => t.NextFlowState(), Times.Never);
            turn.Verify(t => t.SetState<RobberDiscardState>(), Times.Never);
        }
コード例 #3
0
ファイル: RollStateTest.cs プロジェクト: Corne/VOC
        public void ExpectNothingToHappenIfCommandNotRollDice(GameCommand command)
        {
            var dice = CreateDice(7);
            var turn = new Mock<IGameTurn>();
            var state = new RollState(turn.Object, dice);
            state.AfterExecute(command);

            turn.Verify(t => t.NextFlowState(), Times.Never);
            turn.Verify(t => t.SetState<RobberDiscardState>(), Times.Never);
        }