예제 #1
0
 public void GuidTest()
 {
     GuidLayoutRenderer layoutRenderer = new GuidLayoutRenderer();
     LogEventInfo logEvent = LogEventInfo.CreateNullEvent();
     string newGuid1 = layoutRenderer.Render(logEvent);
     string newGuid2 = layoutRenderer.Render(logEvent);
     Assert.True(!string.IsNullOrEmpty(newGuid1));
     Assert.True(!string.IsNullOrEmpty(newGuid2));
     Assert.NotEqual(newGuid1, newGuid2);
 }
예제 #2
0
 public void LogEventGuidTest()
 {
     GuidLayoutRenderer layoutRenderer = new GuidLayoutRenderer() { GeneratedFromLogEvent = true };
     LogEventInfo logEvent1 = LogEventInfo.CreateNullEvent();
     string newGuid11 = layoutRenderer.Render(logEvent1);
     string newGuid12 = layoutRenderer.Render(logEvent1);
     Assert.True(!string.IsNullOrEmpty(newGuid11));
     Assert.True(!string.IsNullOrEmpty(newGuid12));
     Assert.Equal(newGuid11, newGuid12);
     LogEventInfo logEvent2 = LogEventInfo.CreateNullEvent();
     string newGuid21 = layoutRenderer.Render(logEvent2);
     string newGuid22 = layoutRenderer.Render(logEvent2);
     Assert.True(!string.IsNullOrEmpty(newGuid21));
     Assert.True(!string.IsNullOrEmpty(newGuid22));
     Assert.Equal(newGuid21, newGuid22);
     Assert.NotEqual(newGuid11, newGuid22);
 }