예제 #1
0
 public void Dispose()
 {
     if (_server == null)
         return;
     _server.Dispose();
     _server = null;
 }
예제 #2
0
 public void Dispose()
 {
     if (_server == null)
     {
         return;
     }
     _server.Dispose();
     _server = null;
 }
예제 #3
0
 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);
         }
     }
 }
예제 #4
0
 public MockWebEndpoint(int port)
 {
     Address = $"http://localhost:{port}/";
     _server = StartServer(port);
 }
예제 #5
0
 public MockWebEndpoint(int port)
 {
     Address = string.Format("http://localhost:{0}/", port);
     _server = StartServer(port);
 }
예제 #6
0
 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);
 }
예제 #8
0
 public void SetUpFixture()
 {
     _mockedPiwikServer = new MockedHttpServer(PiwikBaseUrl);
 }