Add comprehensive backend test suite and helper access

This commit is contained in:
2026-02-05 18:03:50 +01:00
parent 330d87b432
commit 912da11809
11 changed files with 591 additions and 4 deletions

View File

@@ -79,6 +79,13 @@ internal class TestWebApplicationFactory : WebApplicationFactory<Program>
return action(db);
}
public Task<T> WithDbContextAsync<T>(Func<AppDbContext, Task<T>> action)
{
using var scope = Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
return action(db);
}
public HttpClient CreateClientWithCookies()
{
return CreateClient(new WebApplicationFactoryClientOptions