Esempio n. 1
0
        public void ShouldCalculateMonthlyPaymentWhenInputValid()
        {
            var monthlyPaymentAmount = MortgageInstallmentCalculator.CalculateMonthlyPayment(1000, 1, 12);

            Assert.AreEqual(88.8487886783416d, monthlyPaymentAmount, 0.01d);
        }
Esempio n. 2
0
 public void ShouldThrowInvalidInputExceptionOnNegativeInterestRate()
 {
     MortgageInstallmentCalculator.CalculateMonthlyPayment(20, 1, -12);
 }
Esempio n. 3
0
 public void ShouldThrowInvalidInputExceptionOnNegativePrincipalAmount()
 {
     MortgageInstallmentCalculator.CalculateMonthlyPayment(20, -10, 14.5);
 }
Esempio n. 4
0
 public void ShouldThrowInvalidInputExceptionOnNegativeTenure()
 {
     MortgageInstallmentCalculator.CalculateMonthlyPayment(-20, 1, 14.5);
 }