51 references to TestDbContext
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (51)
AspireAzureEfCoreCosmosDBExtensionsTests.cs (18)
27
builder.AddCosmosDbContext<
TestDbContext
>("cosmosConnection", "databaseName", configureDbContextOptions: optionsBuilder =>
36
var
context = host.Services.GetRequiredService<
TestDbContext
>();
68
builder.AddCosmosDbContext<
TestDbContext
>("cosmosConnection", "databaseName",
73
var
context = host.Services.GetRequiredService<
TestDbContext
>();
102
builder.AddCosmosDbContext<
TestDbContext
>("cosmosConnection", "databaseName",
113
var
context = host.Services.GetRequiredService<
TestDbContext
>();
140
builder.AddCosmosDbContext<
TestDbContext
>("cosmos", "test");
144
var
context = host.Services.GetRequiredService<
TestDbContext
>();
166
builder.Services.AddDbContextPool<ITestDbContext,
TestDbContext
>(options => options.UseCosmos(ConnectionString, "databaseName"));
170
builder.Services.AddDbContextPool<
TestDbContext
>(options => options.UseCosmos(ConnectionString, "databaseName"));
173
var exception = Assert.Throws<InvalidOperationException>(() => builder.AddCosmosDbContext<
TestDbContext
>("cosmos", "databaseName"));
189
builder.Services.AddDbContextPool<ITestDbContext,
TestDbContext
>(options => options.UseCosmos(ConnectionString, "databaseName"));
193
builder.Services.AddDbContextPool<
TestDbContext
>(options => options.UseCosmos(ConnectionString, "databaseName"));
196
var exception = Record.Exception(() => builder.AddCosmosDbContext<
TestDbContext
>("cosmos", "databaseName"));
ConformanceTests.cs (7)
15
public class ConformanceTests : ConformanceTests<
TestDbContext
, EntityFrameworkCoreCosmosSettings>
37
=> builder.AddCosmosDbContext<
TestDbContext
>(key ?? "cosmosdb", "TestDatabase", configure);
70
protected override void TriggerActivity(
TestDbContext
service)
84
IDbContextPool<
TestDbContext
>? pool = host.Services.GetService<IDbContextPool<
TestDbContext
>>();
94
TestDbContext
? dbContext = host.Services.GetService<
TestDbContext
>();
EnrichCosmosDbTests.cs (23)
23
builder.Services.AddDbContextPool<
TestDbContext
>(options => options.UseCosmos(ConnectionString, DatabaseName));
24
builder.EnrichCosmosDbContext<
TestDbContext
>(configure);
32
var exception = Assert.Throws<InvalidOperationException>(() => builder.EnrichCosmosDbContext<
TestDbContext
>());
41
builder.Services.AddDbContext<
TestDbContext
>(options => options.UseCosmos(ConnectionString, DatabaseName));
43
builder.EnrichCosmosDbContext<
TestDbContext
>();
56
builder.Services.AddDbContextPool<
TestDbContext
>(optionsBuilder =>
65
builder.EnrichCosmosDbContext<
TestDbContext
>();
68
var
context = host.Services.GetRequiredService<
TestDbContext
>();
89
builder.Services.AddDbContextPool<ITestDbContext,
TestDbContext
>(optionsBuilder =>
94
builder.EnrichCosmosDbContext<
TestDbContext
>();
97
var
context = host.Services.GetRequiredService<ITestDbContext>() as
TestDbContext
;
106
builder.Services.AddDbContext<ITestDbContext,
TestDbContext
>(optionsBuilder =>
111
builder.EnrichCosmosDbContext<
TestDbContext
>();
113
var optionsDescriptor = builder.Services.FirstOrDefault(sd => sd.ServiceType == typeof(DbContextOptions<
TestDbContext
>));
118
var
context = host.Services.GetRequiredService<ITestDbContext>() as
TestDbContext
;
127
builder.Services.AddDbContextPool<ITestDbContext,
TestDbContext
>(optionsBuilder =>
132
builder.EnrichCosmosDbContext<
TestDbContext
>(settings => settings.RequestTimeout = TimeSpan.FromSeconds(456));
135
var exception = Assert.Throws<InvalidOperationException>(host.Services.GetRequiredService<
TestDbContext
>);
148
builder.Services.AddDbContextPool<
TestDbContext
>(optionsBuilder =>
153
builder.EnrichCosmosDbContext<
TestDbContext
>();
tests\Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests\TestDbContext.cs (3)
10
public DbSet<
TestDbContext
.CatalogBrand> CatalogBrands { get; }
15
public TestDbContext(DbContextOptions<
TestDbContext
> options) : base(options)
20
public DbContextOptions<
TestDbContext
> Options { get; }