using JSMR.Infrastructure.Data; namespace JSMR.Tests.Fixtures; public abstract class SearchProviderFixture(MariaDbContainerFixture container) : IAsyncLifetime { public AppDbContext? DbContext { get; private set; } public async ValueTask InitializeAsync() { DbContext = await MariaDbClone.CloneFromTemplateAsync( container.RootConnectionString, container.TemplateDbName, seed: SeedAsync); } protected abstract Task SeedAsync(AppDbContext context); public async ValueTask DisposeAsync() { if (DbContext is not null) { await DbContext.DisposeAsync(); } GC.SuppressFinalize(this); } }