Exemple #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>
 /// Initializes the layout.
 /// </summary>
 public void Initialize()
 {
     Layout.Initialize();
     if (Header != null)
     {
         Header.Initialize();
     }
     if (Footer != null)
     {
         Footer.Initialize();
     }
 }
Exemple #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);
 }