示例#1
0
        public void ApplyEffect_Charges4TimesDiceRentWhenOwnedByAnotherPlayer()
        {
            Player player1 = new Player("Player 1");

            player1.AddCash(2000);

            Player player2 = new Player("Player 2");

            player2.AddCash(2000);

            Board board = new Board();

            utilitySquare       = (UtilitySquare)board.GetSquareAtPosition(12);
            utilitySquare.Owner = player1;

            utilitySquare.ApplyEffect(board, player2, 2);
            Assert.AreEqual(1992, player2.CashOnHand);
        }
示例#2
0
        public void ApplyEffect_Charges10TimesDiceRentWhenOwnedByAnotherPlayerAndOtherUtilityIsOwned()
        {
            Player player1 = new Player("Player 1");

            player1.AddCash(2000);

            Player player2 = new Player("Player 2");

            player2.AddCash(2000);

            Board board = new Board();

            UtilitySquare electricCompany = (UtilitySquare)board.GetSquareAtPosition(12);

            electricCompany.Owner = player1;

            UtilitySquare waterWorks = (UtilitySquare)board.GetSquareAtPosition(28);

            waterWorks.Owner = player1;

            electricCompany.ApplyEffect(board, player2, 2);
            Assert.AreEqual(1980, player2.CashOnHand);
            Assert.AreEqual(2020, player1.CashOnHand);
        }