示例#1
0
        public void DelegateLogEventContextProvider_AddProperties_AddsProperty()
        {
            var provider = new DelegateLogEventContextProvider("Test Property", () => Guid.NewGuid().ToString());
            var logEvent = new LogEvent()
            {
                EventName  = "Test event",
                Properties = new Dictionary <string, object>()
            };

            provider.AddProperties(logEvent, null);
            Guid.Parse((string)logEvent.Properties["Test Property"]);
        }
示例#2
0
 public void DelegateLogEventContextProvider_Constructor_ThrowsOnNullFunction()
 {
     var provider = new DelegateLogEventContextProvider("Test Property", null);
 }
示例#3
0
 public void DelegateLogEventContextProvider_Constructor_ConstructsOkWithNullFilter()
 {
     var provider = new DelegateLogEventContextProvider("Test Property", () => Guid.NewGuid().ToString(), null);
 }
示例#4
0
 public void DelegateLogEventContextProvider_Constructor_ThrowsOnNullPropertyName()
 {
     var provider = new DelegateLogEventContextProvider(null, () => Guid.NewGuid().ToString());
 }