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

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