27 lines
768 B
C#
27 lines
768 B
C#
namespace ColaFlow.Modules.Identity.IntegrationTests.Infrastructure;
|
|
|
|
/// <summary>
|
|
/// Database Fixture for In-Memory Database Tests
|
|
/// Implements IClassFixture for xUnit test lifecycle management
|
|
/// Each test class gets its own isolated database instance
|
|
/// </summary>
|
|
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);
|
|
}
|
|
}
|