예제 #1
0
        public void LoanEngineCanProcessALoan()
        {
            //Arrange - Add a loan type
            IAdministrator administrator = null;

            administrator = AdministratorCreator.Create("test", bll);
            administrator.SetUpLoanType(1, "Type1", 1, 25, 4.5);

            bool applied = applicant.ApplyForALoan(1, 1, 20000);

            //Act
            bool processed = loanEngine.ProcessALoan(dal.loans.Count);

            var loanProcessed = dal.loans.Where(x => x.LoanID == dal.loans.Count).FirstOrDefault();

            //Assert
            Assert.AreEqual(processed, true);
            Assert.IsNotNull(loanProcessed.LoanApprovedRejectedByEngineDate);
            Assert.AreNotSame(loanProcessed.LoanStatus, 1);
            Assert.AreNotSame(loanProcessed.CreditChecker, 0);
        }
        public void AdminCanCreateALoanType()
        {
            //Inject DAL and BLL classes for testing
            IDALLoanAPound dal = null;

            dal = DALLoanAPoundCreator.Create("test");
            IBLLLoanAPound bll = null;

            bll = BLLLoanAPoundCreator.Create("test", dal);


            IAdministrator administrator = null;

            administrator = AdministratorCreator.Create("test", bll);

            //Act
            administrator.SetUpLoanType(1, "Type1", 1, 25, 4.5);

            //Assert
            Assert.AreEqual(dal.loantypes.Count, 1);
        }