예제 #1
0
        public void test_revolver_loan_same_payments()
        {
            var      revolverStrategy = new CapitalStrategyRevolver();
            DateTime start            = November(20, 2003);
            DateTime expiry           = November(20, 2007);

            Loan revolverLoan = LoanCreator.NewRevolver(LOAN_AMOUNT, start, expiry, HIGH_RISK_TAKING);

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

            Assert.Equal(40027, revolverStrategy.Duration(revolverLoan), (int)TWO_DIGIT_PRECISION);
            Assert.Equal(4002700, revolverStrategy.Capital(revolverLoan), (int)TWO_DIGIT_PRECISION);
        }
예제 #2
0
        public void Init()
        {
            var pacnetService = new Mock <IPacnetService>();

            pacnetService.Setup(x => x.SendMoney(It.IsAny <int>(), It.IsAny <decimal>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()))
            .Returns(new PacnetReturnData());

            var agreementsGenerator = new Mock <IAgreementsGenerator>();
            var context             = new Mock <IEzbobWorkplaceContext>();

            _loanDetailsModelBuilder = new ChangeLoanDetailsModelBuilder();
            _loanBuilder             = new LoanBuilder(_loanDetailsModelBuilder);

            _lc = new LoanCreator(pacnetService.Object, agreementsGenerator.Object, context.Object, _loanBuilder, null);
            SetUp();
        }
예제 #3
0
        public void test_advised_line_loan_same_payments()
        {
            var      advisedLineStrategy = new CapitalStrategyAdvisedLine();
            DateTime start    = November(20, 2003);
            DateTime maturity = November(20, 2006);
            DateTime expiry   = November(20, 2007);

            Loan advisedLineLoan = LoanCreator.NewAdvisedLine(LOAN_AMOUNT, start, expiry, LOW_RISK_TAKING);

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

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

            Loan termLoan = LoanCreator.NewTermLoan(LOAN_AMOUNT, start, maturity, HIGH_RISK_TAKING);

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

            var termStrategy = new CapitalStrategyTermLoan();

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