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 MoveTo(IPlayer player, Int32 newPosition)
        {
            if (PositionOf[player] > newPosition)
            {
                banker.Collect(player, GameConstants.PASS_GO_PAYMENT);
            }

            MoveToAndDontPassGo(player, newPosition);
        }
示例#3
0
        public void AtEndOfGame_PlayerWithMostMoneyWins()
        {
            var theChosenOne = game.CurrentPlayer;

            banker.Collect(theChosenOne, 9266);

            game.Play();

            Assert.AreEqual(theChosenOne, game.Winner);
        }
 public void Execute(IPlayer player)
 {
     banker.Collect(player, payment);
 }
 public void CollectTwoHundred()
 {
     banker.Collect(player, 200);
     Assert.AreEqual(1700, banker.Money[player]);
 }
示例#6
0
 private void SellHouseOrHotel(Property property)
 {
     property.SellHouseOrHotel();
     banker.Collect(ownedSpaces[property], property.HousePrice / 2);
 }