public async Task HealthCheckWithSuccess() { var healthService = new HealthService(); List <string> services = new List <string> { "test-health", "test-categories", "test-audio", "test-images", "test-text", "test-web", }; Queue <HttpResponseMessage> responses = new Queue <HttpResponseMessage>(); services.ForEach(serviceName => { var healthCheckResponse = new HealthCheckResponse() { Status = HealthCheckStatus.OK, Application = serviceName, }; var response = new HttpResponseMessage() { StatusCode = HttpStatusCode.OK, Content = new StringContent( JsonConvert.SerializeObject(healthCheckResponse), Encoding.UTF8, "application/json"), }; responses.Enqueue(response); }); var mockHttpHandler = Mockers.MockHttpMessageHandler(responses); HealthService.Client = new HttpClient(mockHttpHandler.Object); var results = await healthService.HealthCheck().ConfigureAwait(false); Assert.AreEqual(5, results.Count, $"There were not 5 health check statuses in the response, there were {results.Count}"); }