public void CanGenerateSchedule_MonthlyPaymentsShouldBeCorrect() { var sut = new FixedMonthlyRateCalculationStrategy(); var parameters = new LoanCalculationParameters { Principal = 100000, AnnualInterestRate = 0.06D, PaybackTimeInYears = 10 }; var ret = sut.GetPayments(parameters); ExpectMonthlyPayment(new Payment { Interest = 500, Principal = 610.21D, Balance = 99389.79D }, ret[0]); ExpectMonthlyPayment(new Payment { Interest = 471.99D, Principal = 638.22D, Balance = 93758.81D }, ret[9]); ExpectMonthlyPayment(new Payment { Interest = 5.52D, Principal = 1104.68D, Balance = 0 }, ret[119]); }
public void CanGenerateSchedule_ShouldGenerateProperNumberOfPayments() { var sut = new FixedMonthlyRateCalculationStrategy(); var parameters = new LoanCalculationParameters { Principal = 100000, AnnualInterestRate = 0.06D, PaybackTimeInYears = 10 }; var ret = sut.GetPayments(parameters); Assert.AreEqual(120, ret.Count); }