示例#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);
        }
示例#2
0
 public GetContactDetailQueryHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
示例#3
0
 public DeleteZoneCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
示例#4
0
 public GetCollectorListQueryHandler(PrestamAppDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
示例#5
0
 public GetZonesListQueryHandlerTests(QueryTestFixture fixture)
 {
     _context = fixture.Context;
     _mapper  = fixture.Mapper;
 }
示例#6
0
 public CommandTestBase()
 {
     Context = PrestamAppContextFactory.Create();
 }
示例#7
0
 public CreateLoanWithDuesCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
示例#8
0
 public CreatePersonalRefferenceCommandHandler(PrestamAppDbContext context)
 {
     _context = context;
 }
示例#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;
 }