Exemplo n.º 1
0
        public PrestamAppDbContext GetDbContext(bool useSqlLite = false)
        {
            var builder = new DbContextOptionsBuilder <PrestamAppDbContext>();

            if (useSqlLite)
            {
                builder.UseSqlite("DataSource=:memory:", x => { });
            }
            else
            {
                builder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            }

            var dbContext = new PrestamAppDbContext(builder.Options);

            if (useSqlLite)
            {
                // SQLite needs to open connection to the DB.
                // Not required for in-memory-database.
                dbContext.Database.OpenConnection();
            }

            dbContext.Database.EnsureCreated();

            return(dbContext);
        }
Exemplo n.º 2
0
 public GetContactDetailQueryHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
Exemplo n.º 3
0
 public DeleteZoneCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public GetCollectorListQueryHandler(PrestamAppDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Exemplo n.º 5
0
 public GetZonesListQueryHandlerTests(QueryTestFixture fixture)
 {
     _context = fixture.Context;
     _mapper  = fixture.Mapper;
 }
Exemplo n.º 6
0
 public CommandTestBase()
 {
     Context = PrestamAppContextFactory.Create();
 }
Exemplo n.º 7
0
 public CreateLoanWithDuesCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
Exemplo n.º 8
0
 public CreatePersonalRefferenceCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
Exemplo n.º 9
0
 public GetAddressTypeListQueryHandler(PrestamAppDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public GetTimeFrameListQueryHandler(PrestamAppDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public DeleteCollectorCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
 public CreateContactCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }