Inheritance: IDisposable
 private void Given_a_healthy_endpoint_working_for_some_time()
 {
     _restEndpoint = MockWebEndpointFactory.CreateNew();
     _restEndpoint.SetupStatusPlainResponse(HttpStatusCode.OK, "hello world!");
     _identifier = _client.RegisterEndpoint(MonitorTypes.Http, _restEndpoint.StatusAddress, "test", "test");
     Thread.Sleep((int) (Timeouts.HealthCheckInterval.TotalMilliseconds * 10));
 }
 public void Dispose()
 {
     if (_restEndpoint == null)
         return;
     _restEndpoint.Dispose();
     _restEndpoint = null;
 }
        public void Dispose()
        {
            if (_restEndpoint != null)
            {
                _restEndpoint.Dispose();
                _restEndpoint = null;
            }

            if (_monitorProcess != null)
                AppDomainExecutor.KillAppDomain(_monitorProcess);
        }
 private void Given_a_registered_endpoint()
 {
     _restEndpoint = MockWebEndpointFactory.CreateNew();
     _identifier = _client.RegisterEndpoint(MonitorTypes.Http, _restEndpoint.StatusAddress, "test","test");
 }
 private void Given_a_rest_endpoint()
 {
     _restEndpoint = MockWebEndpointFactory.CreateNew();
 }
Exemple #6
0
 public static void SetupStatusResponse(this MockWebEndpoint endpoint, HttpStatusCode code)
 {
     endpoint.Reconfigure(builder => builder.WhenGet("/status").Respond(code));
 }
Exemple #7
0
 public static void SetupStatusPlainResponse(this MockWebEndpoint endpoint, HttpStatusCode code, string text)
 {
     endpoint.Reconfigure(builder => builder.WhenGet("/status").RespondContent(code, r => new StringContent(text, Encoding.UTF8, "text/plain")));
 }
Exemple #8
0
 public static void SetupStatusResponse(this MockWebEndpoint endpoint, HttpStatusCode code, object model)
 {
     endpoint.Reconfigure(builder => builder.WhenGet("/status").RespondContent(code, r => new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json")));
 }