public void DoNotBuyUnaffordableRealEstate() { banker.Pay(player, banker.Money[player] - property.Price + 1); var money = banker.Money[player]; ownableHandler.Land(player, 0); Assert.AreEqual(money, banker.Money[player]); }
public void LosersDontCollect() { banker.Pay(loser, banker.Money[loser] + 1); var playerMoney = banker.Money[player]; payCard.Execute(player); Assert.IsTrue(banker.IsBankrupt(loser)); Assert.AreEqual(playerMoney - 400, banker.Money[player]); }
public void OnePlayerLosesInTwoPlayerGame_OtherPlayerWins() { SetupGameWithPlayers(2); var winner = game.CurrentPlayer; game.TakeTurn(); var loser = game.CurrentPlayer; banker.Pay(loser, banker.Money[loser] + 1); game.TakeTurn(); Assert.AreEqual(winner, game.Winner); }
public void BuyIfAtLeast500OnHand() { player.OwnableStrategy = new BuyOrMortgageIf500(); renter.OwnableStrategy = new BuyOrMortgageIf500(); banker.Pay(player, banker.Money[player] - 499); var money = banker.Money[player]; realEstateHandler.Land(player, 0); Assert.AreEqual(money, banker.Money[player]); banker.Collect(player, 1); money = banker.Money[player]; realEstateHandler.Land(player, 0); Assert.AreEqual(money - 1, banker.Money[player]); realEstateHandler.DevelopProperties(player); money = banker.Money[renter]; realEstateHandler.Land(renter, 0); Assert.AreEqual(money, banker.Money[renter]); banker.Collect(player, 1); realEstateHandler.DevelopProperties(player); money = banker.Money[renter]; realEstateHandler.Land(renter, 0); Assert.AreEqual(money - 1, banker.Money[renter]); }
public void Execute(IPlayer player) { var houses = realEstateHandler.GetNumberOfHouses(player); var hotels = realEstateHandler.GetNumberOfHotels(player); var payment = houses * houseCost + hotels * hotelPremium; banker.Pay(player, payment); }
private void TestIncomeTaxWith(Int32 thisMuchMoney) { banker.Pay(player, banker.Money[player] - thisMuchMoney); incomeTax.LandOn(player); var paid = Math.Min(thisMuchMoney / IncomeTax.INCOME_TAX_PERCENTAGE_DIVISOR, IncomeTax.INCOME_TAX_FLAT_RATE); Assert.AreEqual(thisMuchMoney - paid, banker.Money[player], Convert.ToString(thisMuchMoney)); }
public void LosersDontPay() { banker.Pay(loser, banker.Money[loser] + 1); var playerMoney = banker.Money[player]; collectCard.Execute(player); Assert.AreEqual(playerMoney + 400, banker.Money[player]); }
private void Buy(IPlayer player, OwnableSpace ownableSpace) { banker.Pay(player, ownableSpace.Price); ownedSpaces[ownableSpace] = player; if (ownableSpace is Property) { SetMonopolyFlags(player, ownableSpace as Property); } else if (ownableSpace is Railroad) { SetRailroadCount(player); } else { SetBothUtilitiesOwnedFlag(); } }
public void GoesBrokeBailingOutOfJail_DoesNotGo() { player.JailStrategy = new NeverPay(); banker.Pay(player, banker.Money[player] - 1); jailHandler.Imprison(player); for (var i = 0; i < 3; i++) { turnHandler.TakeTurn(player); } Assert.IsTrue(banker.IsBankrupt(player)); Assert.AreEqual(BoardConstants.JAIL_OR_JUST_VISITING, boardHandler.PositionOf[player]); }
public override void LandOn(IPlayer player) { banker.Pay(player, LUXURY_TAX); }
private void Bail(IPlayer player) { banker.Pay(player, GameConstants.COST_TO_GET_OUT_OF_JAIL); turnsInJail.Remove(player); }
public void PayOneHundred() { banker.Pay(player, 100); Assert.AreEqual(1400, banker.Money[player]); }
public override void LandOn(IPlayer player) { var amountToPay = Math.Min(banker.Money[player] / INCOME_TAX_PERCENTAGE_DIVISOR, INCOME_TAX_FLAT_RATE); banker.Pay(player, amountToPay); }
public void BankruptWhilePaying() { banker.Pay(player, banker.Money[player] - 1); railroadCard.Execute(player); Assert.IsTrue(banker.IsBankrupt(player)); }
public void Execute(IPlayer player) { banker.Pay(player, payment); }