Example #1
0
        public ProdJsonExceptionFilterShould()
            : base()
        {
            HostingEnvironment = new HostingEnvironment();

            ExpectedError = new ApiError
            {
                Message = "A server error occurred.",
                Detail  = ExceptionContext.Exception.Message
            };

            ExceptionFilter = new JsonExceptionFilter(HostingEnvironment);
        }
Example #2
0
        public DevJsonExceptionFilterShould()
            : base()
        {
            HostingEnvironment = new HostingEnvironment()
            {
                EnvironmentName = "Development"
            };

            ExpectedError = new ApiError
            {
                Message = ExceptionContext.Exception.Message,
                Detail  = ExceptionContext.Exception.StackTrace
            };

            ExceptionFilter = new JsonExceptionFilter(HostingEnvironment);
        }