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