Esempio n. 1
2
 /// <summary>
 /// Render layout <paramref name="layout"/> with <paramref name="logEventInfo"/> and compare result with <paramref name="expected"/>.
 /// </summary>
 protected static void AssertLayoutRendererOutput(Layout layout, LogEventInfo logEventInfo, string expected)
 {
     layout.Initialize(null);
     string actual = layout.Render(logEventInfo);
     layout.Close();
     Assert.Equal(expected, actual);
 }
 /// <summary>
 /// Closes the layout.
 /// </summary>
 public void Close()
 {
     Layout.Close();
     if (Header != null)
     {
         Header.Close();
     }
     if (Footer != null)
     {
         Footer.Close();
     }
 }
Esempio n. 3
0
 protected void AssertLayoutRendererOutput(Layout l, string expected)
 {
     l.Initialize(null);
     string actual = l.Render(LogEventInfo.Create(LogLevel.Info, "loggername", "message"));
     l.Close();
     Assert.AreEqual(expected, actual);
 }