public void Dispose() { if (_server == null) return; _server.Dispose(); _server = null; }
public void Dispose() { if (_server == null) { return; } _server.Dispose(); _server = null; }
public void should_be_able_create_server_and_build() { using (var server = new MockedHttpServer("http://localhost:1122")) { var builder = new MockedHttpServerBuilder(); builder.WhenGet("/test").Respond(HttpStatusCode.OK); builder.Build(server); using (var httpClient = new HttpClient()) { var response = httpClient.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost:1122/test")).Result; Assert.Equal(HttpStatusCode.OK, response.StatusCode); } } }
public MockWebEndpoint(int port) { Address = $"http://localhost:{port}/"; _server = StartServer(port); }
public MockWebEndpoint(int port) { Address = string.Format("http://localhost:{0}/", port); _server = StartServer(port); }
public void SetUpFixture() { _mockedPiwikServer = new MockedHttpServer(PiwikBaseUrl); }