public async Task AsHttpResponseData_ExceptionIsValidationException_ReturnsResponseWithAllErrorsAndStatusBadRequest()
        {
            // arrange
            var request = new MockedHttpRequestData(new MockedFunctionContext());
            var errors  = new[]
            {
                new ValidationFailure("prop1", "err1")
                {
                    ErrorCode = "code1"
                },
                new ValidationFailure("prop2", "err2")
                {
                    ErrorCode = "code2"
                }
            };
            var exception = new ValidationException(errors);

            // act
            var actual = await exception.AsHttpResponseDataAsync(request.HttpRequestData).ConfigureAwait(false);

            var actualFunctionError = JsonSerializer.Deserialize <ErrorResponse>(
                ((MemoryStream)actual.Body).ToArray(),
                new JsonSerializerOptions {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            }) !;

            // assert
            var detailErrors = actualFunctionError.Error.Details !.ToArray();

            Assert.Equal(HttpStatusCode.BadRequest, actual.StatusCode);
            Assert.Equal(2, detailErrors.Length);
            for (var i = 0; i < detailErrors.Length; i++)
            {
                var expectedError = errors[i];
                var detail        = detailErrors[i];
                Assert.Equal(expectedError.ErrorCode, detail.Code);
                Assert.Equal(expectedError.ErrorMessage, detail.Message);
                Assert.Equal(expectedError.PropertyName, detail.Target);
            }
        }