Exemplo n.º 1
0
        public void ReturnsResultOfWinningCheckWhenTakingTurn()
        {
            MockBoard mockBoard = new MockBoard(5, true);
            Player    player    = new Player("Sam", mockBoard, new MockDice());

            Assert.True(player.TakeTurn(MockConsole.Empty()));
        }
Exemplo n.º 2
0
        public void ChecksIfTheyHaveWonAfterTheirTurnUsingTheirFinalPosition()
        {
            MockBoard mockBoard = new MockBoard(5);
            Player    player    = new Player("Sam", mockBoard, new MockDice());

            player.TakeTurn(MockConsole.Empty());

            mockBoard.AssertWinCheckedForPosition(5);
        }
Exemplo n.º 3
0
        public void PassesDiceRollIntoBoard()
        {
            MockBoard mockBoard = new MockBoard(5);
            Player    player    = new Player("Manoj", mockBoard, new MockDice(3));

            player.TakeTurn(MockConsole.Empty());

            mockBoard.AssertNewPositionCalculatedWithDiceRoll(3);
        }
Exemplo n.º 4
0
        public void ItUsesTheBoardToCalculateItsNewPosition()
        {
            MockBoard mockBoard = new MockBoard();
            Player    player    = new Player("Manoj", mockBoard, new MockDice());

            player.TakeTurn(MockConsole.Empty());

            mockBoard.AssertNewPositionCalculatedWithPreviousPosition(1);
        }
Exemplo n.º 5
0
        public void PassesCurrentPositionIntoBoard()
        {
            MockBoard mockBoard = new MockBoard(5);
            Player    player    = new Player("Manoj", mockBoard, new MockDice());

            player.TakeTurn(MockConsole.Empty());
            player.TakeTurn(MockConsole.Empty());

            mockBoard.AssertNewPositionCalculatedWithPreviousPosition(5);
        }