Exemple #1
0
 public virtual void CreateDatabase()
 {
     _store = SqliteTestStore.GetOrCreateShared(DatabaseName, () =>
     {
         using (var context = new ChipsContext(ServiceProvider))
         {
             context.Database.EnsureClean();
         }
     });
 }
 public override SqliteTestStore CreateTestStore()
 {
     return(SqliteTestStore.GetOrCreateShared(DatabaseName, () =>
     {
         using (var context = new LoadContext(_options))
         {
             context.Database.EnsureClean();
             Seed(context);
         }
     }));
 }
Exemple #3
0
            public override SqliteTestStore CreateTestStore()
            {
                return(SqliteTestStore.GetOrCreateShared(DatabaseName, () =>
                {
                    var optionsBuilder = new DbContextOptionsBuilder()
                                         .UseSqlite(SqliteTestStore.CreateConnectionString(DatabaseName))
                                         .UseInternalServiceProvider(_serviceProvider);

                    using (var context = new StoreGeneratedFixupContext(optionsBuilder.Options))
                    {
                        context.Database.EnsureClean();
                        Seed(context);
                    }
                }));
            }
Exemple #4
0
 public override SqliteTestStore CreateTestStore()
 => SqliteTestStore.GetOrCreateShared(DatabaseName, EnsureCreated);