Example #1
0
        public void CanBeMortgagedTest()
        {
            var      group     = new Group(2, 200);
            Property property  = new Street(37, group, 350, new int[] { 35, 175, 500, 1100, 1300, 1500 }, "Park Place");
            Property property1 = new Street(37, group, 350, new int[] { 35, 175, 500, 1100, 1300, 1500 }, "Park Place");

            Assert.IsTrue(property.CanBeMortaged());  //Undeveloped property
            property.DevelopProperty(-1);
            Assert.IsFalse(property.CanBeMortaged()); //Already mortgaged
            property.DevelopProperty(1);
            Assert.IsFalse(property.CanBeMortaged()); //1 house on property
            property.DevelopProperty(0);
            property1.DevelopProperty(1);
            Assert.IsFalse(property.CanBeMortaged()); //1 house on property
        }
Example #2
0
        public void CanBeMortgagedOneStreet()
        {
            //Test one Street
            var player = 1;
            var group  = new Group(1, 50);
            var street = new Street(21, group, 220, new int[] { 18, 90, 250, 700, 875, 1050 }, "Kentucky Ave");

            //Player owns the street
            street.BoughtByPlayer(player);
            group.GetAmountPlayerOwns(player);

            Assert.IsTrue(street.CanBeMortaged());

            street.DevelopProperty(-1);     //Street already mortgaged

            Assert.IsFalse(street.CanBeMortaged());
        }
Example #3
0
        public void CanBeMortgagedMultipleStreets()
        {
            var group   = new Group(3, 50);
            var street  = new Street(21, group, 220, new int[] { 18, 90, 250, 700, 875, 1050 }, "Kentucky Ave");
            var street1 = new Street(21, group, 220, new int[] { 18, 90, 250, 700, 875, 1050 }, "Kentucky Ave");
            var street2 = new Street(21, group, 220, new int[] { 18, 90, 250, 700, 875, 1050 }, "Kentucky Ave");

            //Undeveloped property
            Assert.IsTrue(street.CanBeMortaged());
            Assert.IsTrue(street1.CanBeMortaged());
            Assert.IsTrue(street2.CanBeMortaged());

            //Street already mortgaged
            street.DevelopProperty(-1);
            street1.DevelopProperty(-1);
            street2.DevelopProperty(-1);
            Assert.IsFalse(street.CanBeMortaged());
            Assert.IsFalse(street1.CanBeMortaged());
            Assert.IsFalse(street2.CanBeMortaged());
        }
Example #4
0
        public void MultipleMortgageTest()
        {
            var      group     = new Group(3, 300);
            Property property  = new Street(31, group, 300, new int[] { 26, 130, 390, 900, 1100, 1275 }, "Pacific Ave");
            Property property1 = new Street(32, group, 300, new int[] { 26, 130, 390, 900, 1100, 1275 }, "North Carolina Ave");
            Property property2 = new Street(34, group, 320, new int[] { 28, 150, 390, 900, 1200, 1400 }, "Pennsylvania Ave");

            Assert.IsTrue(property1.CanBeMortaged()); //Undeveloped property
            property2.DevelopProperty(2);
            property.DevelopProperty(-1);
            Assert.IsFalse(property2.CanBeMortaged()); //2 houses on property
            Assert.IsFalse(property.CanBeMortaged());  //Already mortgaged
        }