public async Task HealthReturnsServiceUnavailableWhenException()
        {
            // Arrange
            var expectedResult = new StatusCodeResult((int)HttpStatusCode.ServiceUnavailable);
            var function       = new HealthHttpTrigger(fakeLogger, fakeDocumentService);

            A.CallTo(() => fakeDocumentService.PingAsync()).Throws <HttpRequestException>();

            // Act
            var result = await function.Health(A.Fake <HttpRequest>()).ConfigureAwait(false);

            // Assert
            A.CallTo(() => fakeDocumentService.PingAsync()).MustHaveHappenedOnceExactly();

            var statusResult = Assert.IsType <StatusCodeResult>(result);

            Assert.Equal(expectedResult.StatusCode, statusResult.StatusCode);
        }
        public async Task HealthReturnsSuccessWhenHealthy()
        {
            // Arrange
            var expectedResult = new OkResult();
            var function       = new HealthHttpTrigger(fakeLogger, fakeDocumentService);

            A.CallTo(() => fakeDocumentService.PingAsync()).Returns(true);

            // Act
            var result = await function.Health(A.Fake <HttpRequest>()).ConfigureAwait(false);

            // Assert
            A.CallTo(() => fakeDocumentService.PingAsync()).MustHaveHappenedOnceExactly();

            var statusResult = Assert.IsType <OkResult>(result);

            Assert.Equal(expectedResult.StatusCode, statusResult.StatusCode);
        }