db testing

This commit is contained in:
Paul Schneider 2026-09-07 20:02:56 +01:00
commit b75d0add7d
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
3 changed files with 38 additions and 10 deletions

View file

@ -189,6 +189,20 @@ public sealed class WebServerFixture : WebHostFixture
return app;
}
public void ResetAndMigrateDatabase()
{
using var scope = Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
db.Database.EnsureDeleted();
if (db.Database.IsRelational())
{
db.Database.Migrate();
return;
}
db.Database.EnsureCreated();
}
protected override async Task<WebApplication> ConfigurePipelineAsync(WebApplication app)
{
// The MSBuild target CopyYavscOrgStaticAssets in