public void TearDown() { // It's important to dispose a WebApplicationFactory // so that it properly shuts down the in memory server after // each test. Otherwise it can leak memory and processes. _factory.Dispose(); }
public void OneTimeTearDown() { using var scope = _factory.Services.CreateScope(); var dbContext = scope.ServiceProvider.GetRequiredService <ApplicationDbContext>(); dbContext.Database.EnsureDeleted(); _client.Dispose(); _factory.Dispose(); }
public void Dispose() { _factory.Dispose(); }
//Tests... public void Dispose() { _scope.Dispose(); _factory.Dispose(); //Dispose and cleanup anything else... }
public void Dispose() { _factory?.Dispose(); _client?.Dispose(); }
public void Cleanup() => _factory.Dispose();