2026-02-01 08:07:23 -06:00
|
|
|
namespace FiscalOS.API.Tests.Integration;
|
|
|
|
|
|
|
|
|
|
public abstract class IntegrationTest(TestApi testApi) : IClassFixture<TestApi>, IAsyncLifetime
|
|
|
|
|
{
|
2026-03-08 09:15:45 -05:00
|
|
|
protected TestApi Api => testApi;
|
|
|
|
|
protected HttpClient Client => testApi.CreateClient();
|
2026-02-01 08:07:23 -06:00
|
|
|
|
2026-02-01 11:31:46 -06:00
|
|
|
public async ValueTask InitializeAsync()
|
2026-02-01 08:07:23 -06:00
|
|
|
{
|
2026-03-08 09:15:45 -05:00
|
|
|
await Api.EnsureDbCreatedAsync();
|
2026-02-02 04:49:00 -06:00
|
|
|
}
|
|
|
|
|
|
2026-02-01 11:31:46 -06:00
|
|
|
public async ValueTask DisposeAsync()
|
|
|
|
|
{
|
2026-03-08 09:15:45 -05:00
|
|
|
await Api.EnsureDbDeletedAsync();
|
2026-02-01 08:07:23 -06:00
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
|
}
|
|
|
|
|
}
|