public void GoToJail_PlayerLandsOnByRollingNonDoubles_ShouldMoveToJail() { board.AddPlayerToBoard(horse, 27); horse.Bank = 333; horse.IsInJail = false; Turn turn = new Turn(board, always3Dice); turn.Take(horse); Assert.Equal(10, horse.Position); Assert.True(horse.IsInJail); Assert.Equal(333, horse.Bank); }
public void RollsDoubles_ThreeTimesButPassesGoBeforeThirdTurn_ShouldCollect200Dollars() { Board board = new MockJailBoard(); Dice dice = new Dice(6, new DoublesGenerator()); Player horse = new Player("Horse"); horse.Bank = 200; Turn turn = new Turn(board, dice); board.AddPlayerToBoard(horse, 37); turn.Take(horse); Assert.Equal(400, horse.Bank); Assert.True(horse.IsInJail); Assert.Equal(10, horse.Position); }
public void RollsDoubles_ThreeTimesInSingleTurn_ShouldGoToJail() { Board board = new MockJailBoard(); Dice dice = new Dice(6, new DoublesGenerator()); Player horse = new Player("Horse"); horse.Bank = 200; Turn turn = new Turn(board, dice); board.AddPlayerToBoard(horse, 0); turn.Take(horse); Assert.Equal(200, horse.Bank); Assert.True(horse.IsInJail); Assert.Equal(10, horse.Position); }