示例#1
0
        public void testResidential()
        {
            //creates instance of factory
            Residential resid = new Residential("Te Papa", 150, 6, 50, 50, "cyan");

            //check that it is right type
            Type t = new Residential().GetType();
            Assert.IsInstanceOf(t, resid);
        }
示例#2
0
        public void checkOnlyOneHotelPerProperty()
        {
            Residential resid = new Residential("");
            resid.setHotelCount(1);
            resid.addHotel();

            Assert.AreEqual(1, resid.getHotelCount());
            resid.setHotelCount(0);
            resid.addHotel();
            Assert.AreEqual(1, resid.getHotelCount());
        }
示例#3
0
        public void addMaxHouse()
        {
            Residential resid = new Residential("");
            resid.setHotelCount(4);
            resid.addHouse();

            Assert.AreEqual(4, resid.getHouseCount());
            resid.setHouseCount(0);
            resid.addHouse();
            Assert.AreEqual(4, resid.getHouseCount());
        }
示例#4
0
        public void checkGetsAndSetFunctions()
        {
            Residential resid = new Residential("Te Papa", 150, 6, 50, 50, "cyan");
            resid.setMortgaged(true);
            Assert.True(resid.getMortgaged());

            Board.access().addProperty(resid);
            Assert.That(resid.getOwner(), Is.StringMatching("Banker"));
            Assert.That(resid.getName(), Is.StringMatching("Ohakune Carrot"));
            Assert.That(resid.getGroupColours(), Is.StringMatching("Brown"));
            Assert.AreEqual(100, resid.getPrice());
            Assert.AreEqual(50, resid.getHouseCost());
            Assert.AreEqual(50, resid.getHotelCost());
        }
示例#5
0
 public void addMaxHotel()
 {
     Residential resid = new Residential("");
     resid.setHotelCount(1);
     resid.addHotel();
 }