public WhenHandlingAGetOganisationFailedException()
        {
            var exceptionContentList = new[]
            {
                "fist thing failed",
                "second this too",
                "third thing was out of office"
            };

            _exception = new GetOrganisationFailed(exceptionContentList);

            var handler = new GetOrganisationFailedHandler();

            _handledProblem = handler.GetApiProblemFor(_exception);
        }
Beispiel #2
0
        public OrganisationNotFoundApiProblem GetApiProblemFor(GetOrganisationFailed exception)
        {
            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }

            return(new OrganisationNotFoundApiProblem
            {
                ProblemInstanceUri = ProblemDetails.GetProblemNumber(),
                HttpStatus = StatusCodes.Status400BadRequest,
                ProblemTypeUri = ProblemDetails.GetTypeUriFor(exception),
                Title = ProblemDetails.DefaultTitle,
                Detail = exception.Message,
                Attempts = exception.AttemptResults.ToList()
            });
        }