20 lines
756 B
C#
20 lines
756 B
C#
|
|
using Microsoft.AspNetCore.Hosting;
|
||
|
|
using Microsoft.AspNetCore.Mvc.Testing;
|
||
|
|
|
||
|
|
namespace TeamUp.IntegrationTests;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Drives the real <see cref="Program"/> web host against the test container, in Development so
|
||
|
|
/// migrations apply on startup and the OpenAPI document is mapped.
|
||
|
|
/// </summary>
|
||
|
|
public sealed class TeamUpWebFactory(string connectionString) : WebApplicationFactory<Program>
|
||
|
|
{
|
||
|
|
protected override void ConfigureWebHost(IWebHostBuilder builder)
|
||
|
|
{
|
||
|
|
builder.UseEnvironment("Development");
|
||
|
|
builder.UseSetting("ConnectionStrings:Postgres", connectionString);
|
||
|
|
builder.UseSetting("Database:ApplyMigrationsOnStartup", "true");
|
||
|
|
builder.UseSetting("OpenTelemetry:OtlpEndpoint", string.Empty);
|
||
|
|
}
|
||
|
|
}
|