namespace ColaFlow.Modules.Identity.IntegrationTests.Infrastructure; /// /// Database Fixture for In-Memory Database Tests /// Implements IClassFixture for xUnit test lifecycle management /// Each test class gets its own isolated database instance /// public class DatabaseFixture : IDisposable { public ColaFlowWebApplicationFactory Factory { get; } public HttpClient Client { get; } public DatabaseFixture() { // Use In-Memory Database for fast, isolated tests Factory = new ColaFlowWebApplicationFactory(useInMemoryDatabase: true); Client = Factory.CreateClient(); } public void Dispose() { Client?.Dispose(); Factory?.Dispose(); GC.SuppressFinalize(this); } }