public void to_string_is_correct() { _residentialProperty.AddHouse(); var toString = _residentialProperty.ToString(); Assert.IsTrue(toString.Contains("\t Houses: 1")); }
public void developed_property_cant_be_mortgaged() { _residentialProperty = NewResidential(); _residentialProperty.AddHouse(); Assert.IsFalse(_residentialProperty.MortgageProperty()); }
public void rent_for_property_with_one_house_is_correct() { _residentialProperty = NewResidential(); _residentialProperty.AddHouse(); const decimal rentPlusOneHouse = 28; var rentWithHouse = _residentialProperty.GetRent(); Assert.AreEqual(rentPlusOneHouse, rentWithHouse); }
public void adding_hotel() { Board.Access().ResetBoard(); _residentialProperty = NewResidential(); for (var i = 0; i <= 4; i++) { _residentialProperty.AddHouse(); } Assert.AreEqual(0, _residentialProperty.GetHouseCount()); Assert.AreEqual(32, Board.Access().Houses); Assert.IsTrue(_residentialProperty.HasHotel); }
public void five_houses_equates_to_hotel() { _residentialProperty = NewResidential(); // Shouldn't have houses or hotel to start with Assert.IsFalse(_residentialProperty.HasHotel); Assert.AreEqual(0, _residentialProperty.GetHouseCount()); for (var i = 0; i <= 4; i++) { _residentialProperty.AddHouse(); } Assert.IsTrue(_residentialProperty.HasHotel); }
public void property_cant_be_developed_further() { Board.Access().ResetBoard(); var property = new Residential("Test"); var property2 = new Residential("Test2"); property.SetOwner(ref _player1); property2.SetOwner(ref _player1); Board.Access().AddProperty(property); Board.Access().AddProperty(property2); property.AddHouse(); _gameOfMonopoly.BuyHouse(_player1, property, true); Assert.AreEqual(1, property.GetHouseCount()); }
public void no_hotels_left() { Board.Access().ResetBoard(); Board.Access().Hotels = 0; var property = new Residential("Test"); property.SetOwner(ref _player1); for (var i = 0; i <= 3; i++) { property.AddHouse(); } Board.Access().AddProperty(property); _gameOfMonopoly.BuyHouse(_player1, property, true); Assert.AreEqual(4, property.GetHouseCount()); Assert.IsFalse(property.HasHotel); }
public void selling_house() { Board.Access().ResetBoard(); var property = new Residential("Test"); property.SetOwner(ref _player1); property.AddHouse(); var playersBalanceBefore = _player1.GetBalance(); var expectedIncreaseAmount = property.GetHouseCost() / 2; Board.Access().AddProperty(property); _gameOfMonopoly.SellHouse(_player1, property); // Players balance should go up by half house cost Assert.AreEqual(playersBalanceBefore + expectedIncreaseAmount, _player1.GetBalance()); // Property shouldn't have house anymore Assert.AreEqual(0, property.GetHouseCount()); // Board's houses should be back to full Assert.AreEqual(32, Board.Access().Houses); }
public void property_has_house_after_adding_house() { _residentialProperty = NewResidential(); _residentialProperty.AddHouse(); Assert.IsTrue(_residentialProperty.GetHouseCount() == 1); }
public void selling_house() { Board.Access().ResetBoard(); var property = new Residential("Test"); property.SetOwner(ref _player1); property.AddHouse(); var playersBalanceBefore = _player1.GetBalance(); var expectedIncreaseAmount = property.GetHouseCost()/2; Board.Access().AddProperty(property); _gameOfMonopoly.SellHouse(_player1, property); // Players balance should go up by half house cost Assert.AreEqual(playersBalanceBefore + expectedIncreaseAmount, _player1.GetBalance()); // Property shouldn't have house anymore Assert.AreEqual(0, property.GetHouseCount()); // Board's houses should be back to full Assert.AreEqual(32, Board.Access().Houses); }