public virtual void CreateDatabase() { _store = SqliteTestStore.GetOrCreateShared(DatabaseName, () => { using (var context = new ChipsContext(ServiceProvider)) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); } }); }
public override SqliteTestStore CreateTestStore() { return(SqliteTestStore.GetOrCreateShared(DatabaseName, () => { var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlite(SqliteTestStore.CreateConnectionString(DatabaseName)); using (var context = new StoreGeneratedContext(_serviceProvider, optionsBuilder.Options)) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); } })); }