public virtual void CreateDatabase()
 {
     _store = SqliteTestStore.GetOrCreateShared(DatabaseName, () =>
     {
         using (var context = new ChipsContext(ServiceProvider))
         {
             context.Database.EnsureClean();
         }
     });
 }
Пример #2
0
 public override SqliteTestStore CreateTestStore()
 {
     return(SqliteTestStore.GetOrCreateShared(DatabaseName, () =>
     {
         using (var context = new FindContext(_options))
         {
             context.Database.EnsureClean();
             Seed(context);
         }
     }));
 }
Пример #3
0
            public override SqliteTestStore CreateTestStore()
            {
                return(SqliteTestStore.GetOrCreateShared(DatabaseName, () =>
                {
                    var optionsBuilder = new DbContextOptionsBuilder()
                                         .UseSqlite(SqliteTestStore.CreateConnectionString(DatabaseName))
                                         .UseInternalServiceProvider(_serviceProvider);

                    using (var context = new StoreGeneratedContext(optionsBuilder.Options))
                    {
                        context.Database.EnsureClean();
                    }
                }));
            }
Пример #4
0
            public override SqliteTestStore CreateTestStore()
            {
                return(SqliteTestStore.GetOrCreateShared(DatabaseName, () =>
                {
                    var optionsBuilder = new DbContextOptionsBuilder();
                    optionsBuilder.UseSqlite(SqliteTestStore.CreateConnectionString(DatabaseName));

                    using (var context = new GraphUpdatesContext(_serviceProvider, optionsBuilder.Options))
                    {
                        context.Database.EnsureDeleted();
                        if (context.Database.EnsureCreated())
                        {
                            Seed(context);
                        }
                    }
                }));
            }
 public override SqliteTestStore CreateTestStore()
 => SqliteTestStore.GetOrCreateShared(DatabaseName, EnsureCreated);