Example #1
0
        public void PlayerLandsOnUnownedRailRoad_PurchasesIt()
        {
            var cashBeforeVisit = banker.GetPlayerBalance(player);

            shortLineRailRoad.Land(player);

            Assert.AreEqual(((IOwnableProperty)shortLineRailRoad).Price, cashBeforeVisit - banker.GetPlayerBalance(player));
            Assert.IsTrue(player.OwnsProperty(shortLineRailRoad));
        }
Example #2
0
        public void CalculatePaymentOneOwned()
        {
            var expectedPayment = 25;

            railRoad1.Land(owner);

            var actualPayment = railRoad1.CalculatePayment(player);

            Assert.AreEqual(expectedPayment, actualPayment);
        }
Example #3
0
        public void PlayerLandsOnOwnedRailRoadPaysRent()
        {
            pennsylvaniaRailRoad.Land(game.CreatePlayerAccount("Horse"));
            var cashBeforeVisit = banker.GetPlayerBalance(player);

            pennsylvaniaRailRoad.Land(player);

            Assert.AreEqual(25, cashBeforeVisit - banker.GetPlayerBalance(player));
            Assert.IsFalse(player.OwnsProperty(pennsylvaniaRailRoad));
        }
Example #4
0
        public void CalculatePayementThreeOwned()
        {
            var expectedPayment = 100;

            railRoad1.Land(owner);
            railRoad2.Land(owner);
            railRoad3.Land(owner);

            var actualPayment = railRoad1.CalculatePayment(player);

            Assert.AreEqual(expectedPayment, actualPayment);
        }
Example #5
0
        public void FourRailRoadsOwned_PlayerPays200Dollars()
        {
            readingRailRoad.Land(horse);
            pennsylvaniaRailRoad.Land(horse);
            bAndORailRoad.Land(horse);
            shortLineRailRoad.Land(horse);
            var cashBeforeLand = banker.GetPlayerBalance(player);

            readingRailRoad.Land(player);

            Assert.AreEqual(200, cashBeforeLand - banker.GetPlayerBalance(player));
        }