Beispiel #1
0
        public void ReInitializeTest()
        {
            _dbEntities     = new Mock <LoansDbEntities>().Object;
            _loanRepository = SetUpLoanRepository();
            var unitOfWork = new Mock <UnitOfWork.IUnitOfWork>();

            unitOfWork.SetupGet(s => s.LoanRepository).Returns(_loanRepository);
            _unitOfWork  = unitOfWork.Object;
            _loanService = new LoanService(_unitOfWork);
        }
        public void Setup()
        {
            _loans          = SetUpLoans();
            _dbEntities     = new Mock <LoansDbEntities>().Object;
            _loanRepository = SetUpLoanRepository();
            var unitOfWork = new Mock <UnitOfWork.IUnitOfWork>();

            unitOfWork.SetupGet(s => s.LoanRepository).Returns(_loanRepository);
            _unitOfWork  = unitOfWork.Object;
            _loanService = new LoanService(_unitOfWork);
            _client      = new HttpClient {
                BaseAddress = new Uri(ServiceBaseURL)
            };
        }
Beispiel #3
0
 public LoanRepository(LoansDbEntities context)
 {
     this._context = context;
     this._dbSet   = _context.Set <Loan>();
 }
 public UnitOfWork()
 {
     _context = new LoansDbEntities();
 }