public void ExceptionMapper_Should_Add2ExceptionMappers() { var options = new HttpExceptionsOptions(); options.ExceptionMapper <Exception, ProblemDetailsExceptionMapper <Exception> >(); options.ExceptionMapper <HttpException, ProblemDetailsExceptionMapper <HttpException> >(); options.ExceptionMapperDescriptors.Should().HaveCount(2); }
public void ExceptionMapper_Should_OverrideExceptionMapper() { var options = new HttpExceptionsOptions(); options.ExceptionMapper <Exception, ProblemDetailsExceptionMapper <Exception> >(); options.ExceptionMapper <Exception, TestProblemDetailsExceptionMapper>(); options.ExceptionMapperDescriptors.Should().HaveCount(1); options.ExceptionMapperDescriptors.First().Value.Type.Should().Be <TestProblemDetailsExceptionMapper>(); }