public void mortgaged_property_cant_be_mortgaged_again() { _residentialProperty = NewResidential(); _residentialProperty.MortgageProperty(); // Should now be mortgaged after mortgaging Assert.IsTrue(_residentialProperty.IsMortgaged); // Trying to mortgage again should return false Assert.IsFalse(_residentialProperty.MortgageProperty()); }
public void developed_property_cant_be_mortgaged() { _residentialProperty = NewResidential(); _residentialProperty.AddHouse(); Assert.IsFalse(_residentialProperty.MortgageProperty()); }
public void property_is_mortgaged() { var property = new Residential(); property.SetOwner(ref _player1); property.MortgageProperty(); Board.Access().AddProperty(property); _gameOfMonopoly.BuyHouse(_player1, property, true); Assert.AreEqual(0, property.GetHouseCount()); }
public void unmortgaging_property_results_in_correct_balance_alterations() { _residentialProperty = NewResidential(); var testPlayer = GetMeANewPlayer(); var paybackValue = _residentialProperty.GetMortgageValue() + (_residentialProperty.GetMortgageValue() * 10 / 100);// mortgage plus 10% _residentialProperty.SetOwner(ref testPlayer); _residentialProperty.MortgageProperty(); var ownerBalaceBeforeUnmortgage = testPlayer.GetBalance(); var bankerBalanceBeforeUnmortgage = Banker.Access().GetBalance(); _residentialProperty.UnmortgageProperty(); // The property's owner should have paid the mortgage payback value Assert.AreEqual(ownerBalaceBeforeUnmortgage - paybackValue, testPlayer.GetBalance()); // The banker should have received the mortgage payback value Assert.AreEqual(bankerBalanceBeforeUnmortgage + paybackValue, Banker.Access().GetBalance()); }
public void mortgaging_property_results_in_correct_balance_alterations() { _residentialProperty = NewResidential(); var testPlayer = GetMeANewPlayer(); var mortgageValue = _residentialProperty.GetMortgageValue(); var ownerBalanceBefore = testPlayer.GetBalance(); var bankerBalanceBefore = Banker.Access().GetBalance(); _residentialProperty.SetOwner(ref testPlayer); _residentialProperty.MortgageProperty(); // Property should now be mortgaged Assert.IsTrue(_residentialProperty.IsMortgaged); // The property's owner should have received the mortgage money Assert.AreEqual(ownerBalanceBefore + mortgageValue, testPlayer.GetBalance()); // The banker should have paid the mortgage money Assert.AreEqual(bankerBalanceBefore - mortgageValue, Banker.Access().GetBalance()); }
public void property_is_mortgaged() { var property = new Residential(); property.SetOwner(ref _player1); property.MortgageProperty(); Board.Access().AddProperty(property); _gameOfMonopoly.BuyHouse(_player1, property, true); Assert.AreEqual(0, property.GetHouseCount()); }
public void unmortgaging_property_results_in_correct_balance_alterations() { _residentialProperty = NewResidential(); var testPlayer = GetMeANewPlayer(); var paybackValue = _residentialProperty.GetMortgageValue() + (_residentialProperty.GetMortgageValue() * 10 / 100);// mortgage plus 10% _residentialProperty.SetOwner(ref testPlayer); _residentialProperty.MortgageProperty(); var ownerBalaceBeforeUnmortgage = testPlayer.GetBalance(); var bankerBalanceBeforeUnmortgage = Banker.Access().GetBalance(); _residentialProperty.UnmortgageProperty(); // The property's owner should have paid the mortgage payback value Assert.AreEqual(ownerBalaceBeforeUnmortgage - paybackValue, testPlayer.GetBalance()); // The banker should have received the mortgage payback value Assert.AreEqual(bankerBalanceBeforeUnmortgage + paybackValue, Banker.Access().GetBalance()); }
public void mortgaging_property_results_in_correct_balance_alterations() { _residentialProperty = NewResidential(); var testPlayer = GetMeANewPlayer(); var mortgageValue = _residentialProperty.GetMortgageValue(); var ownerBalanceBefore = testPlayer.GetBalance(); var bankerBalanceBefore = Banker.Access().GetBalance(); _residentialProperty.SetOwner(ref testPlayer); _residentialProperty.MortgageProperty(); // Property should now be mortgaged Assert.IsTrue(_residentialProperty.IsMortgaged); // The property's owner should have received the mortgage money Assert.AreEqual(ownerBalanceBefore + mortgageValue, testPlayer.GetBalance()); // The banker should have paid the mortgage money Assert.AreEqual(bankerBalanceBefore - mortgageValue, Banker.Access().GetBalance()); }
public void developed_property_cant_be_mortgaged() { _residentialProperty = NewResidential(); _residentialProperty.AddHouse(); Assert.IsFalse(_residentialProperty.MortgageProperty()); }
public void mortgaged_property_cant_be_mortgaged_again() { _residentialProperty = NewResidential(); _residentialProperty.MortgageProperty(); // Should now be mortgaged after mortgaging Assert.IsTrue(_residentialProperty.IsMortgaged); // Trying to mortgage again should return false Assert.IsFalse(_residentialProperty.MortgageProperty()); }