예제 #1
0
        public static LoanAppDbContext Create()
        {
            var options = new DbContextOptionsBuilder <LoanAppDbContext>()
                          .UseInMemoryDatabase("Test")
                          .Options;

            var context = new LoanAppDbContext(options);

            context.Database.EnsureCreated();
            var user1 = new User
            {
                EmailAddress = "*****@*****.**",
                FirstName    = "Kathy",
                LastName     = "Matthews",
                IsBorrower   = true,
                IsLender     = false
            };

            var user2 = new User
            {
                EmailAddress = "*****@*****.**",
                FirstName    = "Pablo",
                LastName     = "Jorreto",
                IsBorrower   = false,
                IsLender     = true
            };



            var loan1 = new Loan
            {
                Borrower   = user1,
                Lender     = user2,
                LoanTypeId = 1,
                IsPaid     = false,
                LoanValue  = 100
            };
            var loan2 = new Loan
            {
                Borrower   = user1,
                Lender     = user2,
                LoanTypeId = 1,
                IsPaid     = true,
                LoanValue  = 1000
            };

            //context.LoanTypes.Add(loanType);
            context.Users.Add(user1);
            context.Users.Add(user2);
            context.Loans.Add(loan1);
            context.Loans.Add(loan2);
            context.SaveChanges();
            return(context);
        }
예제 #2
0
 public AuthController(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #3
0
 public NoteController(LoanAppDbContext context)
 {
     _context = context;
 }
 public LoansController(LoanAppDbContext context)
 {
     _context = context;
 }
 public EscrowController(LoanAppDbContext context)
 {
     _context = context;
 }
 public TrusteeController(LoanAppDbContext context)
 {
     _context = context;
 }
 public BrokerServicingController(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #8
0
 public GetUserBorrowsQueryHandler(LoanAppDbContext context)
 {
     _context = context;
 }
 public AddtlServicingController(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #10
0
 public static void Destroy(LoanAppDbContext context)
 {
     //context.Database.EnsureDeleted();
     context.Dispose();
 }
 public GetAllLendersAndBorrowersQueryTests(TestFixture fixture)
 {
     _context      = fixture.Context;
     _queryHandler = new GetAllLendersAndBorrowersQueryHandler(_context);
 }
예제 #12
0
 public CreateUserCommandHandler(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #13
0
 public AddLoanCommandHandler(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #14
0
 public AddLoanCommandTests(TestFixture fixture)
 {
     _context        = fixture.Context;
     _commandHandler = new AddLoanCommandHandler(_context);
 }
예제 #15
0
 public CostExpenseController(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #16
0
 public CreateUserCommandTest(TestFixture fixture)
 {
     _context        = fixture.Context;
     _commandHandler = new CreateUserCommandHandler(_context);
 }
예제 #17
0
 public FinanceChargeController(LoanAppDbContext context)
 {
     _context = context;
 }
 public DeductionController(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #19
0
 public AssignmentController(LoanAppDbContext context)
 {
     _context = context;
 }
 public PropertyController(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #21
0
 public TestFixture()
 {
     Context = ContextFactory.Create();
 }
예제 #22
0
 public BorrowersController(LoanAppDbContext context)
 {
     _context = context;
 }
예제 #23
0
 public GetAllLendersAndBorrowersQueryHandler(LoanAppDbContext context)
 {
     _context = context;
 }