Unindent() public method

Decreases the IndentLevel by 1.
public Unindent ( ) : void
return void
Beispiel #1
0
            public void DecreasesIndentLevel()
            {
                LogManager.RegisterDebugListener();
                var log = new Log(typeof(int)) { IndentLevel = 2 };

                Assert.AreEqual(2, log.IndentLevel);

                log.Unindent();

                Assert.AreEqual(1, log.IndentLevel);
            }
Beispiel #2
0
            public void WriteMessagesWithUnIndent()
            {
                LogManager.RegisterDebugListener();
                var log = new Log(typeof(int));

                LogMessageEventArgs eventArgs = null;
                log.LogMessage += (sender, e) => eventArgs = e;

                log.Indent();
                log.Info("Indented message");
                log.Unindent();
                log.Info("Unindented message");

                Assert.IsNotNull(eventArgs);
                Assert.AreEqual(log, eventArgs.Log);
                Assert.AreEqual(LogEvent.Info, eventArgs.LogEvent);
                Assert.AreEqual("[System.Int32] Unindented message", eventArgs.Message);
            }