public void render_with_custom_text_formatting()
        {
            var message = "**Dude, you're trying to divide by zero!**";

            // Register a purely textual representation of the exception
            // that maintains whitespace
            ExceptionFormatting.AsText <DivideByZeroException>(ex => message);

            var exception = new DivideByZeroException();

            ExceptionFormatting.ToDisplayMessage(exception, out display)
            .ShouldBe(message);

            display.ShouldBe(ErrorDisplay.text);
        }
Esempio n. 2
0
 public MartenSystem()
 {
     ExceptionFormatting.AsText <ShouldAssertException>(x => x.Message);
 }