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")); } } }
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)); }
public void Generate_HideDetails_Null() { Assert.IsTrue(ErrorPageGenerator.Generate(new Exception("test"), true).Contains("html")); }
public void Generate_ExceptionNoFrames_Generated() { Assert.IsNotNull(ErrorPageGenerator.Generate(new Exception("test"))); }