You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/NLog.Extensions.Logging.Tests/LoggerTests.cs
+50-7Lines changed: 50 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -88,27 +88,54 @@ public void TestMessagePropertiesList()
88
88
}
89
89
90
90
[Fact]
91
-
publicvoidTestScopeProperty()
91
+
publicvoidTestScopeParameter()
92
92
{
93
93
GetRunner().LogWithScopeParameter();
94
94
95
+
vartarget=GetTarget();
96
+
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 parameters |20",target.Logs.LastOrDefault());
97
+
}
98
+
99
+
[Fact]
100
+
publicvoidTestScopeProperty()
101
+
{
102
+
GetRunner().LogWithScopeProperty();
103
+
95
104
vartarget=GetTarget();
96
105
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 parameters |Hello",target.Logs.LastOrDefault());
97
106
}
98
107
108
+
[Fact]
109
+
publicvoidTestScopePropertyInt()
110
+
{
111
+
GetRunner().LogWithScopeIntProperty();
112
+
113
+
vartarget=GetTarget();
114
+
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 parameters |42",target.Logs.LastOrDefault());
115
+
}
116
+
99
117
[Fact]
100
118
publicvoidTestScopePropertyList()
101
119
{
102
-
GetRunner().LogWithScopeParameterList();
120
+
GetRunner().LogWithScopePropertyList();
103
121
104
122
vartarget=GetTarget();
105
123
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 parameters |Hello",target.Logs.LastOrDefault());
106
124
}
107
125
126
+
[Fact]
127
+
publicvoidTestScopeIntPropertyList()
128
+
{
129
+
GetRunner().LogWithScopeIntPropertyList();
130
+
131
+
vartarget=GetTarget();
132
+
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 parameters |42",target.Logs.LastOrDefault());
133
+
}
134
+
108
135
[Fact]
109
136
publicvoidTestScopePropertyDictionary()
110
137
{
111
-
GetRunner().LogWithScopeParameterDictionary();
138
+
GetRunner().LogWithScopePropertyDictionary();
112
139
113
140
vartarget=GetTarget();
114
141
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 parameters |Hello",target.Logs.LastOrDefault());
@@ -303,31 +330,47 @@ public void LogDebugWithMessagePropertiesList()
303
330
_logger.Log(Microsoft.Extensions.Logging.LogLevel.Debug,default(EventId),newList<KeyValuePair<string,object>>(new[]{newKeyValuePair<string,object>("ParameterCount","1")}),null,(s,ex)=>"message with id and 1 property");
304
331
}
305
332
306
-
publicvoidLogWithScope()
333
+
publicvoidLogWithScopeParameter()
307
334
{
308
335
using(_logger.BeginScope("scope1"))
309
336
{
310
337
_logger.LogDebug(20,"message with id and {0} parameters",1);
0 commit comments