Exemplo n.º 1
0
        public void RentaShouldBeCorrectTransferMoney()
        {
            string[] players  = new string[] { "Peter", "Ekaterina", "Alexander" };
            Monopoly monopoly = new Monopoly(players, 3);
            Goods    x        = monopoly.GetFieldByName("Ford");

            monopoly.Buy(1, x);
            x = monopoly.GetFieldByName("Ford");
            monopoly.Renta(2, x);

            Players player1 = monopoly.GetPlayerInfo(1);

            Assert.AreEqual(5750, player1.Cash);
            Players player2 = monopoly.GetPlayerInfo(2);

            Assert.AreEqual(5750, player2.Cash);
        }
Exemplo n.º 2
0
        public void PlayerBuyNoOwnedCompanies()
        {
            string[] players  = new string[] { "Peter", "Ekaterina", "Alexander" };
            Monopoly monopoly = new Monopoly(players, 3);

            string expectedField = "Ford";

            Goods x = monopoly.GetFieldByName(expectedField);

            monopoly.Buy(0, x);

            Players actualPlayer   = monopoly.GetPlayerInfo(0);
            Players expectedPlayer = new Players("Peter", 0, 5500);

            Assert.AreEqual(expectedPlayer, actualPlayer);

            Goods actualField = monopoly.GetFieldByName("Ford");

            //we have chainged the owner
            // Assert.AreEqual(expectedField, actualField.Name);

            Assert.AreEqual(actualField.Owner, 0);
        }
Exemplo n.º 3
0
        public void PlayerBuyOwnedCompanies()
        {
            string[] players  = new string[] { "Peter", "Ekaterina", "Alexander" };
            Monopoly monopoly = new Monopoly(players, 3);

            string expectedField = "Lamoda";

            Goods x = monopoly.GetFieldByName(expectedField);

            bool expected     = false;
            bool actualresult = monopoly.Buy(1, x);


            Assert.AreEqual(expected, actualresult);
        }