private static async Task Noop_when_database_does_not_exist_test(bool async) { using (var testDatabase = OracleTestStore.Create("NonExisting")) { using (var context = new OracleDatabaseCreatorTest.BloggingContext(testDatabase)) { var creator = OracleDatabaseCreatorTest.GetDatabaseCreator(context); Assert.False(async ? await creator.ExistsAsync() : creator.Exists()); if (async) { Assert.False(await creator.EnsureDeletedAsync()); } else { Assert.False(creator.EnsureDeleted()); } Assert.Equal(ConnectionState.Closed, context.Database.GetDbConnection().State); Assert.False(async ? await creator.ExistsAsync() : creator.Exists()); Assert.Equal(ConnectionState.Closed, context.Database.GetDbConnection().State); } } }
public IncludeOneToOneQueryOracleFixture() { _testStore = OracleTestStore.Create("OneToOneQueryTest"); _options = new DbContextOptionsBuilder() .UseOracle(_testStore.ConnectionString, b => b.ApplyConfiguration()) .UseInternalServiceProvider(new ServiceCollection() .AddEntityFrameworkOracle() .AddSingleton(TestModelSource.GetFactory(OnModelCreating)) .AddSingleton <ILoggerFactory>(TestSqlLoggerFactory) .BuildServiceProvider(validateScopes: true)) .Options; using (var context = new DbContext(_options)) { context.Database.EnsureCreated(); AddTestData(context); } }