Esempio n. 1
0
        public void CalculateNumberOfPaymentsForGivenAmount(double Principal, double InterestRate, double paymentAmount, double Expected)
        {
            var amSchedule       = new AmoritizationSchedule();
            var numberOfPayments = amSchedule.CalculateNumberOfPayments(Principal, InterestRate, paymentAmount);

            Assert.Equal(Expected, numberOfPayments);
        }
Esempio n. 2
0
        public void GeneratePaymentSchedule(double Principal, double InterestRate, double paymentAmount, double Expected)
        {
            var amSchedule       = new AmoritizationSchedule();
            var numberOfPayments = amSchedule.GenerateSchedule(Principal, InterestRate, paymentAmount);

            Assert.Equal(Expected, numberOfPayments.ToList().Count());
        }
Esempio n. 3
0
        public void CalculatePaymentAmountPerPeriod(double Principal, double InterestRate, int numberOfPayments, double Expected)
        {
            var amSchedule    = new AmoritizationSchedule();
            var paymentAmount = amSchedule.CalculatePaymentAmountPerPeriod(Principal, InterestRate, numberOfPayments);

            Assert.Equal(Expected, Math.Round(paymentAmount, 2));
        }