public JailBoardTests() { board = new MockJailBoard(); horse = new Player("Horse"); always3Dice = new Dice(6, new AlwaysGenerateThree()); alwaysDubTwoDice = new Dice(6, new AlwaysGenerateDubTwo()); neverDubDice = new Dice(6, new NonDoublesGenerator()); }
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); }