namespace NeonSprawl.Server.Tests.Game.PositionState; /// /// Collection fixture: ensures Postgres is reachable (starts Docker Compose from repo root when not in CI), /// exposes the shared , then disposes the factory and runs /// docker compose down only if this harness started Compose. /// public sealed class PostgresIntegrationHarness : IAsyncLifetime { public PostgresWebApplicationFactory Factory { get; } = new(); public async Task InitializeAsync() { await PostgresDockerHelper.EnsurePostgresOrStartDockerAsync( Environment.GetEnvironmentVariable("ConnectionStrings__NeonSprawl")).ConfigureAwait(false); } public async Task DisposeAsync() { await Factory.DisposeAsync().ConfigureAwait(false); await PostgresDockerHelper.TearDownIfWeStartedAsync().ConfigureAwait(false); } }