public void nonmortgaged_property_cant_be_unmortgaged() { _residentialProperty = NewResidential(); // Shouldn't be mortgaged Assert.IsFalse(_residentialProperty.IsMortgaged); // So we shouldn't be able to unmortgage it Assert.IsFalse(_residentialProperty.UnmortgageProperty()); }
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 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 nonmortgaged_property_cant_be_unmortgaged() { _residentialProperty = NewResidential(); // Shouldn't be mortgaged Assert.IsFalse(_residentialProperty.IsMortgaged); // So we shouldn't be able to unmortgage it Assert.IsFalse(_residentialProperty.UnmortgageProperty()); }