Пример #1
0
 public void Generate_WithInnerException_HtmlPageText()
 {
     try
     {
         string?text = null;
         // ReSharper disable PossibleNullReferenceException
         text !.IndexOf("test", StringComparison.Ordinal);
         // ReSharper restore PossibleNullReferenceException
     }
     catch (Exception e)
     {
         try
         {
             throw new Exception("test 2", e);
         }
         catch (Exception ex)
         {
             Assert.IsTrue(ErrorPageGenerator.Generate(ex).Contains("html"));
         }
     }
 }
Пример #2
0
        private static string GenerateErrorResponse(this ILifetimeScope scope, Exception e, bool minimalStyle)
        {
            var settings = scope.Resolver.Resolve <ISimplifyWebSettings>();

            return(ErrorPageGenerator.Generate(e, settings.HideExceptionDetails, settings.ErrorPageDarkStyle, minimalStyle));
        }
Пример #3
0
 public void Generate_HideDetails_Null()
 {
     Assert.IsTrue(ErrorPageGenerator.Generate(new Exception("test"), true).Contains("html"));
 }
Пример #4
0
 public void Generate_ExceptionNoFrames_Generated()
 {
     Assert.IsNotNull(ErrorPageGenerator.Generate(new Exception("test")));
 }