/// <summary> /// Called when an object is no longer needed. Called just before <see cref="M:System.IDisposable.Dispose" /> /// if the class also implements that. /// </summary> public async Task DisposeAsync() { var host = _host.Services.GetService <IHost>(); await host.StopAsync(); _host?.Dispose(); }
protected virtual void Cleanup() { TestClient?.Dispose(); TestServer?.Dispose(); TestHost?.Dispose(); DbContext?.Dispose(); }
public void Dispose() { TestHost?.Dispose(); HttpClient?.Dispose(); // App Insights takes 2 seconds to flush telemetry and because our container // is disposed on a background task, it doesn't block. So waiting here to ensure // everything is flushed and can't affect subsequent tests. Thread.Sleep(2000); }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { _host?.Dispose(); } disposedValue = true; } }
/// <summary> /// Removes references to all <see cref="BreakdanceTestBase"/> resources. /// </summary> /// <param name="disposing">Whether or not we are actively disposing of resources.</param> protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { TestHost?.Dispose(); } TestHostBuilder = null; TestHost = null; disposedValue = true; } }
public void Dispose() { TestHost?.Dispose(); HttpClient?.Dispose(); }
public void FixtureTearDown() { host.Dispose(); TestFiles.DeleteFiles(); }