Exemplo n.º 1
0
 public override InMemoryTestStore CreateTestStore()
 => InMemoryTestStore.CreateScratch(() =>
 {
     using (var context = CreateContext(null))
     {
         Seed(context);
     }
 },
                                    _serviceProvider);
 public override InMemoryTestStore CreateTestStore()
 => InMemoryTestStore.CreateScratch(
     _serviceProvider,
     nameof(GraphUpdatesInMemoryFixture),
     () =>
 {
     using (var context = CreateContext(null))
     {
         Seed(context);
     }
 });
Exemplo n.º 3
0
 public override InMemoryTestStore CreateTestStore()
 {
     return InMemoryTestStore.CreateScratch(() =>
             {
                 using (var context = new FindContext(_options))
                 {
                     Seed(context);
                 }
             },
         _serviceProvider);
 }
Exemplo n.º 4
0
 public override InMemoryTestStore CreateTestStore()
 => InMemoryTestStore.CreateScratch(
     _serviceProvider,
     nameof(FindInMemoryFixture),
     () =>
 {
     using (var context = new FindContext(_options))
     {
         Seed(context);
     }
 });
Exemplo n.º 5
0
 private static InMemoryTestStore CreateScratch <TContext>(Action <TContext> Seed)
     where TContext : DbContext, new()
 => InMemoryTestStore.CreateScratch(
     () =>
 {
     using (var context = new TContext())
     {
         Seed(context);
     }
 },
     () =>
 {
     using (var context = new Context3595())
     {
         context.GetInfrastructure().GetRequiredService <IInMemoryStoreSource>().GetGlobalStore().Clear();
     }
 });
Exemplo n.º 6
0
 private static InMemoryTestStore CreateScratch <TContext>(Action <TContext> Seed)
     where TContext : DbContext, new()
 => InMemoryTestStore.CreateScratch(
     () =>
 {
     using (var context = new TContext())
     {
         Seed(context);
     }
 },
     () =>
 {
     using (var context = new Context3595())
     {
         context.GetService <IInMemoryStoreSource>().GetPersistentStore(DatabaseName).Clear();
     }
 });