99 references to TestDbContext
Aspire.Oracle.EntityFrameworkCore.Tests (99)
AspireOracleEFCoreDatabaseExtensionsTests.cs (36)
29builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection"); 32var context = host.Services.GetRequiredService<TestDbContext>(); 45builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", settings => settings.ConnectionString = ConnectionString); 48var context = host.Services.GetRequiredService<TestDbContext>(); 65builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection"); 68var context = host.Services.GetRequiredService<TestDbContext>(); 86builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", configureDbContextOptions: optionsBuilder => 95var context = host.Services.GetRequiredService<TestDbContext>(); 130builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", configureDbContextOptions: optionsBuilder => 139var context = host.Services.GetRequiredService<TestDbContext>(); 175builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", 180var context = host.Services.GetRequiredService<TestDbContext>(); 209builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", 215var context = host.Services.GetRequiredService<TestDbContext>(); 242builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection"); 246var context = host.Services.GetRequiredService<TestDbContext>(); 268builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseOracle(ConnectionString)); 272builder.Services.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString)); 275var exception = Assert.Throws<InvalidOperationException>(() => builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection")); 291builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(options => options.UseOracle(ConnectionString)); 295builder.Services.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString)); 298var exception = Record.Exception(() => builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection")); 311builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", o => o.InstrumentationOptions = null); 314var context = host.Services.GetRequiredService<TestDbContext>(); 327builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", o => o.InstrumentationOptions = s => s.SetDbStatementForText = true); 330var context = host.Services.GetRequiredService<TestDbContext>();
ConformanceTests.cs (9)
20public class ConformanceTests : ConformanceTests<TestDbContext, OracleEntityFrameworkCoreSettings> 76=> builder.AddOracleDatabaseDbContext<TestDbContext>("orclconnection", configure); 87protected override void TriggerActivity(TestDbContext service) 114IDbContextPool<TestDbContext>? pool = host.Services.GetService<IDbContextPool<TestDbContext>>(); 125TestDbContext? dbContext = host.Services.GetService<TestDbContext>(); 164var service = host.Services.GetRequiredService<TestDbContext>();
ConformanceTests_TypeSpecificConfig.cs (1)
19new($"Aspire:Oracle:EntityFrameworkCore:{typeof(TestDbContext).Name}:ConnectionString", ConnectionString)
EnrichOracleDatabaseTests.cs (50)
28builder.Services.AddDbContextPool<TestDbContext>(options => options.UseOracle(ConnectionString)); 29builder.EnrichOracleDatabaseDbContext<TestDbContext>(configure); 37var exception = Assert.Throws<InvalidOperationException>(() => builder.EnrichOracleDatabaseDbContext<TestDbContext>()); 46builder.Services.AddDbContext<TestDbContext>(options => options.UseOracle(ConnectionString)); 48builder.EnrichOracleDatabaseDbContext<TestDbContext>(); 64builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 72builder.EnrichOracleDatabaseDbContext<TestDbContext>(); 75var context = host.Services.GetRequiredService<TestDbContext>(); 99builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 107builder.EnrichOracleDatabaseDbContext<TestDbContext>(settings => settings.CommandTimeout = 456); 110var exception = Assert.Throws<InvalidOperationException>(host.Services.GetRequiredService<TestDbContext>); 119builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 124var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 127builder.EnrichOracleDatabaseDbContext<TestDbContext>(); 130var context = host.Services.GetRequiredService<TestDbContext>(); 154builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 162var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 165builder.EnrichOracleDatabaseDbContext<TestDbContext>(); 168var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 173var context = host.Services.GetRequiredService<TestDbContext>(); 197builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 205var oldOptionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 208builder.EnrichOracleDatabaseDbContext<TestDbContext>(); 211var context = host.Services.GetRequiredService<TestDbContext>(); 231builder.Services.AddDbContextPool<ITestDbContext, TestDbContext>(optionsBuilder => 236builder.EnrichOracleDatabaseDbContext<TestDbContext>(); 239var context = host.Services.GetRequiredService<ITestDbContext>() as TestDbContext; 248builder.Services.AddDbContext<ITestDbContext, TestDbContext>(optionsBuilder => 253builder.EnrichOracleDatabaseDbContext<TestDbContext>(); 255var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<TestDbContext>)); 260var context = host.Services.GetRequiredService<ITestDbContext>() as TestDbContext; 269builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 274builder.EnrichOracleDatabaseDbContext<TestDbContext>(settings => settings.DisableRetry = true); 277var context = host.Services.GetRequiredService<TestDbContext>(); 297builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 302builder.EnrichOracleDatabaseDbContext<TestDbContext>(settings => settings.DisableRetry = false); 305var exception = Assert.Throws<InvalidOperationException>(host.Services.GetRequiredService<TestDbContext>); 314builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 319builder.EnrichOracleDatabaseDbContext<TestDbContext>(settings => settings.DisableRetry = false); 322var context = host.Services.GetRequiredService<TestDbContext>(); 346builder.Services.AddDbContextPool<TestDbContext>(optionsBuilder => 351builder.EnrichOracleDatabaseDbContext<TestDbContext>();
TestDbContext.cs (3)
10public DbSet<TestDbContext.CatalogBrand> CatalogBrands { get; } 15public TestDbContext(DbContextOptions<TestDbContext> options) : base(options) 20public DbContextOptions<TestDbContext> Options { get; }