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();
        }
Beispiel #2
0
        public void FutureValue()
        {
            decimal actual = LoanFunctions.FutureValue(periods, presentValue, rate, monthlyPayment, type);

            Assert.AreEqual(futureValue, actual);
        }
Beispiel #3
0
        public void PresentValueEnd()
        {
            decimal actual = LoanFunctions.PresentValue(rate, periods, periods, monthlyPayment, futureValue, type);

            Assert.AreEqual(futureValue, actual);
        }
Beispiel #4
0
        public void MonthlyPayment()
        {
            decimal actual = LoanFunctions.MonthlyPayment(rate, periods, presentValue, futureValue, type);

            Assert.AreEqual(monthlyPayment, actual);
        }
Beispiel #5
0
        public void Periods()
        {
            decimal actual = LoanFunctions.Periods(rate, presentValue, monthlyPayment, futureValue, type);

            Assert.AreEqual(periods, actual);
        }
Beispiel #6
0
        public void PresentValueMid()
        {
            double actual = LoanFunctions.PresentValue(rate, periods, 42, monthlyPayment, futureValue, type);

            Assert.AreEqual(midValue, actual);
        }
Beispiel #7
0
        public void Rate()
        {
            double actual = LoanFunctions.Rate(periods, presentValue, futureValue, monthlyPayment, type);

            Assert.AreEqual(rate, actual);
        }