public void Calculate() { if (validate()) { Curr_Amount = _curr_Amount; Curr_Period = _curr_Period; Curr_InterestRate = _curr_InterestRate; Curr_MonthlyPayment = Math.Round(LoanFunctions.Get_PMT(_curr_InterestRate / 12 / 100.0, _curr_Period, _curr_Amount), 3); Curr_Schedule = LoanFunctions.calculate_schedule_Declining(_curr_InterestRate / 12 / 100.0, _curr_Period, _curr_Amount, Curr_MonthlyPayment); Curr_Stat = LoanFunctions.calculate_stat(Curr_Schedule); } else { Curr_Amount = _curr_Amount; Curr_Period = _curr_Period; Curr_InterestRate = _curr_InterestRate; } StateHasChanged(); }
public void FutureValue() { decimal actual = LoanFunctions.FutureValue(periods, presentValue, rate, monthlyPayment, type); Assert.AreEqual(futureValue, actual); }
public void PresentValueEnd() { decimal actual = LoanFunctions.PresentValue(rate, periods, periods, monthlyPayment, futureValue, type); Assert.AreEqual(futureValue, actual); }
public void MonthlyPayment() { decimal actual = LoanFunctions.MonthlyPayment(rate, periods, presentValue, futureValue, type); Assert.AreEqual(monthlyPayment, actual); }
public void Periods() { decimal actual = LoanFunctions.Periods(rate, presentValue, monthlyPayment, futureValue, type); Assert.AreEqual(periods, actual); }
public void PresentValueMid() { double actual = LoanFunctions.PresentValue(rate, periods, 42, monthlyPayment, futureValue, type); Assert.AreEqual(midValue, actual); }
public void Rate() { double actual = LoanFunctions.Rate(periods, presentValue, futureValue, monthlyPayment, type); Assert.AreEqual(rate, actual); }