2026-02-01 04:27:06 -06:00
|
|
|
namespace FiscalOS.API.Tests.Infra;
|
|
|
|
|
|
|
|
|
|
public class TestApi : WebApplicationFactory<Program>
|
|
|
|
|
{
|
|
|
|
|
protected override void ConfigureWebHost(IWebHostBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
base.ConfigureWebHost(builder);
|
|
|
|
|
|
|
|
|
|
builder.ConfigureLogging(static c => c.ClearProviders());
|
2026-02-01 08:07:23 -06:00
|
|
|
|
|
|
|
|
builder.ConfigureTestServices(static c =>
|
|
|
|
|
{
|
2026-02-03 11:34:58 -06:00
|
|
|
c.AddSingleton(Options.Create(new AppDbContextOptions()
|
2026-02-01 08:07:23 -06:00
|
|
|
{
|
|
|
|
|
DatabaseFilePath = $"{Guid.NewGuid()}.db",
|
2026-02-03 11:34:58 -06:00
|
|
|
}));
|
2026-02-01 08:07:23 -06:00
|
|
|
|
2026-02-03 11:34:58 -06:00
|
|
|
c.AddSingleton(Options.Create(JwtTokenBuilder.DefaultJwtOptions));
|
2026-02-06 06:48:34 -06:00
|
|
|
|
|
|
|
|
c.AddSingleton<IKeyRing>(TestKeyRing.From);
|
2026-02-01 08:07:23 -06:00
|
|
|
});
|
2026-02-01 04:27:06 -06:00
|
|
|
}
|
|
|
|
|
}
|