Indent() public method

Increases the IndentLevel by 1.
public Indent ( ) : void
return void
Ejemplo n.º 1
0
            public void IncreasesIndentLevel()
            {
                LogManager.AddDebugListener();
                var log = new Log(typeof (int));

                Assert.AreEqual(0, log.IndentLevel);

                log.Indent();

                Assert.AreEqual(1, log.IndentLevel);
            }
Ejemplo n.º 2
0
            public void WritesMessagesWithIndent()
            {
                LogManager.AddDebugListener();
                var log = new Log(typeof (int));

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

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

                Assert.IsNotNull(eventArgs);
                Assert.AreEqual(log, eventArgs.Log);
                Assert.AreEqual(LogEvent.Info, eventArgs.LogEvent);
                Assert.AreEqual("  Indented message", eventArgs.Message);
            }