public void StreetRepairs_WithTwoHouses_ShouldPay80Dollars() { Board board = new CardBoard(); StreetRepairs repairs = new StreetRepairs(); Player horse = new Player("Horse"); horse.Bank = 220; board.AddPlayerToBoard(horse, 0); board.Move(horse, 10); board.Move(horse, 1); horse.Build(); repairs.Execute(horse); Assert.Equal(-80, horse.Bank); }
public void AdvanceToRailroad_AllRailroadsOwned_ShouldPayDoubleRentToOwner() { Board board = new CardBoard(); AdvanceToRailroad advToRr = new AdvanceToRailroad(); advToRr.BoardReference = board; Player horse = new Player("Horse"); Player car = new Player("Car"); car.Bank = 2000; board.AddPlayerToBoard(car, 0); board.AddPlayerToBoard(horse, 0); board.Move(car, 4); board.Move(car, 1); board.Move(car, 1); board.Move(car, 1); advToRr.Execute(horse); Assert.Equal(-400, horse.Bank); Assert.Equal(4, horse.Position); }
public void AdvanceToUtility_UtilityOwned_ShouldMovePlayerToWaterWorksAndPayRent() { Board board = new CardBoard(); AdvanceToUtility advToUtil = new AdvanceToUtility(); advToUtil.BoardReference = board; Player horse = new Player("Horse"); Player car = new Player("Car"); car.Bank = 2000; board.AddPlayerToBoard(car, 0); board.AddPlayerToBoard(horse, 0); board.Move(car, 8); horse.LastRoll = (6, 6); advToUtil.Execute(horse); Assert.True((horse.Bank > -120) && (horse.Bank <= -20)); Assert.Equal(8, horse.Position); }