/// <summary> /// This method causes the communication listener to close. Close is a terminal state and this method allows the communication listener to transition to this state in a graceful manner. /// </summary> /// <param name="cancellationToken">Cancellation token</param> /// <returns>A <see cref="Task">Task</see> that represents outstanding operation.</returns> public Task CloseAsync(CancellationToken cancellationToken) { if (cancellationToken.IsCancellationRequested) { ServiceEventSource.Current.ServiceMessage(_context, "WireMock.Net Stopping"); _server.Stop(); _server.Dispose(); ServiceEventSource.Current.ServiceMessage(_context, "WireMock.Net Stopped"); return(Task.FromResult(true)); } return(Task.FromResult(false)); }
protected virtual void Dispose(bool disposing) { if (disposing) { stub.Stop(); stub.Dispose(); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _mockServerSearchEngine.Stop(); _mockServerSearchEngine.Dispose(); } }
public void Dispose() { _mockServer.Stop(); _mockServer.Dispose(); }
public void Dispose() { _server?.Dispose(); }
public static void AfterAll() { mockServer.Stop(); mockServer.Dispose(); }