Example #1
0
        public void test_revolver_loan_same_payments()
        {
            DateTime start  = November(20, 2003);
            DateTime expiry = November(20, 2007);

            Loan revolverLoan = LoanBuilder.Create(LOAN_AMOUNT, start, expiry, HIGH_RISK_TAKING, StrategyEnum.Revolver);

            revolverLoan.Payment(1000.00, November(20, 2004));
            revolverLoan.Payment(1000.00, November(20, 2005));
            revolverLoan.Payment(1000.00, November(20, 2006));

            Assert.Equal(40027, revolverLoan.Duration(), (int)TWO_DIGIT_PRECISION);
            Assert.Equal(4002700, revolverLoan.Capital(), (int)TWO_DIGIT_PRECISION);
        }
Example #2
0
        public void test_advised_line_loan_same_payments()
        {
            DateTime start  = November(20, 2003);
            DateTime expiry = November(20, 2007);

            Loan advisedLineLoan = LoanBuilder.Create(LOAN_AMOUNT, start, expiry, LOW_RISK_TAKING, StrategyEnum.AvisedLine);

            advisedLineLoan.Payment(1000.00, November(20, 2004));
            advisedLineLoan.Payment(1000.00, November(20, 2005));
            advisedLineLoan.Payment(1000.00, November(20, 2006));

            Assert.Equal(40027, advisedLineLoan.Duration(), (int)TWO_DIGIT_PRECISION);
            Assert.Equal(1200810, advisedLineLoan.Capital(), (int)TWO_DIGIT_PRECISION);
        }
Example #3
0
        public void test_term_loan_same_payments()
        {
            DateTime start    = November(20, 2003);
            DateTime maturity = November(20, 2006);

            Loan termLoan = LoanBuilder.Create(LOAN_AMOUNT, start, maturity, HIGH_RISK_TAKING, StrategyEnum.Term);

            termLoan.Payment(1000.00, November(20, 2004));
            termLoan.Payment(1000.00, November(20, 2005));
            termLoan.Payment(1000.00, November(20, 2006));

            Assert.Equal(20027, termLoan.Duration(), (int)TWO_DIGIT_PRECISION);
            Assert.Equal(6008100, termLoan.Capital(), (int)TWO_DIGIT_PRECISION);
        }