Add comprehensive backend test suite and helper access
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user