db testing
This commit is contained in:
parent
555087232c
commit
b75d0add7d
3 changed files with 38 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue