示例#1
0
 public ApiFactory(FakeDatabaseType databaseType, Action <IServiceCollection> configureServices = null, Action <IServiceScope> onWebHostReady = null)
 {
     this.configureServices              = configureServices;
     this.onWebHostReady                 = onWebHostReady;
     testCreationFakeContextDefinition   = new FakeContextDefinition <TestCreationDbContext>(databaseType);
     userManagementFakeContextDefinition = new FakeContextDefinition <UserManagementDbContext>(databaseType);
 }
示例#2
0
        //private ServiceProvider efServiceProvider;

        public FakeContextDefinition(FakeDatabaseType databaseType)
        {
            this.databaseType = databaseType;
            var builder = new DbContextOptionsBuilder <TContext>();

            SetupBuilder(builder);
            options = builder.Options;
        }