public void ShouldCalculateMonthlyPaymentWhenInputValid() { var monthlyPaymentAmount = MortgageInstallmentCalculator.CalculateMonthlyPayment(1000, 1, 12); Assert.AreEqual(88.8487886783416d, monthlyPaymentAmount, 0.01d); }
public void ShouldThrowInvalidInputExceptionOnNegativeInterestRate() { MortgageInstallmentCalculator.CalculateMonthlyPayment(20, 1, -12); }
public void ShouldThrowInvalidInputExceptionOnNegativePrincipalAmount() { MortgageInstallmentCalculator.CalculateMonthlyPayment(20, -10, 14.5); }
public void ShouldThrowInvalidInputExceptionOnNegativeTenure() { MortgageInstallmentCalculator.CalculateMonthlyPayment(-20, 1, 14.5); }