コード例 #1
0
        public void ShouldCalculateMonthlyPaymentWhenInputValid()
        {
            var monthlyPaymentAmount = MortgageInstallmentCalculator.CalculateMonthlyPayment(1000, 1, 12);

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