public bool Stop(HostControl hostControl) { _logger.Debug("Stopping..."); _server.Stop(); _logger.Debug("Stopped"); return(true); }
public async Task InitializeAndSubmitBadResponse() { FluentMockServer server = null; try { server = FluentMockServer.Start(new FluentMockServerSettings { Urls = new[] { "http://+:5010" } }); server .Given(Request.Create().WithPath("/Query").UsingGet()) .RespondWith( Response.Create() .WithStatusCode(200) .WithBody(@"{ ""msg"": ""Hello world!"" }") ); var handler = new PostHandler("http://localhost:5010/"); var file = Path.GetTempFileName(); var result = await handler.SubmitQueryHashAsync(file); Assert.IsNull(result); } finally { server?.Stop(); } }
/// <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)); }
void IDisposable.Dispose() { _server.Stop(); if (_ep != null) { _ep.Dispose(); } }
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(); var standardOutput = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true }; Console.SetOut(standardOutput); }
public async Task InitializeAndSubmitGoodResponse() { FluentMockServer server = null; try { server = FluentMockServer.Start(new FluentMockServerSettings { Urls = new[] { "http://+:5010" } }); server .Given(Request.Create().WithPath("/Query").UsingPost()) .RespondWith( Response.Create() .WithStatusCode(200) .WithBody(@"{ ""guid"": ""00000000-0000-0000-0000-000000000000"", ""status"": ""SUBMITTED"", ""mD5Hash"": ""12345"", ""errorMessage"": null, ""isMalicious"": false }") ); var handler = new PostHandler("http://localhost:5010/"); var file = Path.GetTempFileName(); var result = await handler.SubmitQueryHashAsync(file); Assert.IsNotNull(result); Assert.AreEqual(ResponseStatus.SUBMITTED, result.Status); Assert.AreEqual("12345", result.MD5Hash); Assert.AreEqual(false, result.IsMalicious); Assert.AreEqual(Guid.Empty, result.Guid); Assert.IsNull(result.ErrorMessage); } finally { server?.Stop(); } }
public void Dispose() { server.Stop(); }
public void Dispose() { _server?.Dispose(); Client?.Dispose(); bussinessMock.Stop(); }
private static void Stop(string why) { Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopping because '{why}'"); _server.Stop(); Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopped"); }
public static void ShutdownServer() { Server.Stop(); }
public void TearDown() { server.Stop(); }
public async Task TearDown() { await Database.Users.DeleteOneAsync(x => x.Id == _user.Id); _fluentMockServer.Stop(); }
public void TearDown() { _fakeHackerNewsServer.Stop(); }
public void Dispose() { _mockServer.Stop(); _mockServer.Dispose(); }
public void Dispose() { _server?.Stop(); _serverForProxyForwarding?.Stop(); }
public static void Destroy() { server.Stop(); }
public void TearDown() { _fakeBankServer.Stop(); }
public static void AfterAll() { mockServer.Stop(); mockServer.Dispose(); }
public void ShutdownServer() { _mockServer.Stop(); }
public void Dispose() { _server.Stop(); _server.ResetLogEntries(); //MetricsManager.Shutdown(); }
private static void Stop() { _server.Stop(); }
public void CleanUp() { _server.Stop(); }
public void Teardown() { _server.Stop(); }
public void TearDown() { responseServer.Stop(); }
public static void CleanClass() { stub.Stop(); }
//[TearDown] public void Dispose() { _server?.Stop(); }
public void ShutdownServer() { MockServer?.Stop(); }
public void ShutdownServer() { _server.Stop(); }