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); }
public AuthController(LoanAppDbContext context) { _context = context; }
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; }
public GetUserBorrowsQueryHandler(LoanAppDbContext context) { _context = context; }
public AddtlServicingController(LoanAppDbContext context) { _context = context; }
public static void Destroy(LoanAppDbContext context) { //context.Database.EnsureDeleted(); context.Dispose(); }
public GetAllLendersAndBorrowersQueryTests(TestFixture fixture) { _context = fixture.Context; _queryHandler = new GetAllLendersAndBorrowersQueryHandler(_context); }
public CreateUserCommandHandler(LoanAppDbContext context) { _context = context; }
public AddLoanCommandHandler(LoanAppDbContext context) { _context = context; }
public AddLoanCommandTests(TestFixture fixture) { _context = fixture.Context; _commandHandler = new AddLoanCommandHandler(_context); }
public CostExpenseController(LoanAppDbContext context) { _context = context; }
public CreateUserCommandTest(TestFixture fixture) { _context = fixture.Context; _commandHandler = new CreateUserCommandHandler(_context); }
public FinanceChargeController(LoanAppDbContext context) { _context = context; }
public DeductionController(LoanAppDbContext context) { _context = context; }
public AssignmentController(LoanAppDbContext context) { _context = context; }
public PropertyController(LoanAppDbContext context) { _context = context; }
public TestFixture() { Context = ContextFactory.Create(); }
public BorrowersController(LoanAppDbContext context) { _context = context; }
public GetAllLendersAndBorrowersQueryHandler(LoanAppDbContext context) { _context = context; }