393 references to LatestRecord
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (35)
Logging\AcceptanceTests.cs (29)
179
Assert.Null(logCollector.
LatestRecord
.Exception);
180
Assert.Equal(LogLevel.Information, logCollector.
LatestRecord
.Level);
181
Assert.Equal(LoggingCategory, logCollector.
LatestRecord
.Category);
184
var state = logCollector.
LatestRecord
.StructuredState!;
239
Assert.Null(logCollector.
LatestRecord
.Exception);
240
Assert.Equal(LogLevel.Information, logCollector.
LatestRecord
.Level);
241
Assert.Equal(LoggingCategory, logCollector.
LatestRecord
.Category);
244
var state = logCollector.
LatestRecord
.StructuredState!;
366
var lastRecord = logCollector.
LatestRecord
;
413
Assert.Null(logCollector.
LatestRecord
.Exception);
414
Assert.Equal(LogLevel.Information, logCollector.
LatestRecord
.Level);
415
Assert.Equal(LoggingCategory, logCollector.
LatestRecord
.Category);
418
var state = logCollector.
LatestRecord
.StructuredState;
455
Assert.Null(logCollector.
LatestRecord
.Exception);
456
Assert.Equal(LogLevel.Information, logCollector.
LatestRecord
.Level);
457
Assert.Equal(LoggingCategory, logCollector.
LatestRecord
.Category);
460
var state = logCollector.
LatestRecord
.StructuredState;
573
Assert.Equal(LogLevel.Information, logCollector.
LatestRecord
.Level);
574
Assert.Equal(LoggingCategory, logCollector.
LatestRecord
.Category);
575
Assert.Null(logCollector.
LatestRecord
.Exception);
577
var state = logCollector.
LatestRecord
.StructuredState;
614
Assert.Equal(LogLevel.Information, logCollector.
LatestRecord
.Level);
615
Assert.Equal(LoggingCategory, logCollector.
LatestRecord
.Category);
616
Assert.Null(logCollector.
LatestRecord
.Exception);
618
var state = logCollector.
LatestRecord
.StructuredState;
648
Assert.Equal(LogLevel.Information, logCollector.
LatestRecord
.Level);
649
Assert.Equal(LoggingCategory, logCollector.
LatestRecord
.Category);
650
Assert.Null(logCollector.
LatestRecord
.Exception);
652
var state = logCollector.
LatestRecord
.StructuredState;
Logging\AcceptanceTests.Mvc.cs (5)
72
var logRecord = logCollector.
LatestRecord
;
107
var logRecord = logCollector.
LatestRecord
;
153
var logRecord = logCollector.
LatestRecord
;
197
var logRecord = logCollector.
LatestRecord
;
238
var logRecord = logCollector.
LatestRecord
;
Logging\AcceptanceTests.Routing.cs (1)
72
var logRecord = logCollector.
LatestRecord
;
Microsoft.AspNetCore.HeaderParsing.Tests (3)
HeaderParsingFeatureTests.cs (3)
111
Assert.Equal("Header 'Date' not found.", _logger.Collector.
LatestRecord
.Message);
130
Assert.Equal("Using a default value for header 'Date'.", _logger.Collector.
LatestRecord
.Message);
148
Assert.Equal("Can't parse header 'Date' due to 'Unable to parse date time offset value.'.", _logger.Collector.
LatestRecord
.Message);
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (2)
TelemetryHealthChecksPublisherTests.cs (2)
105
Assert.Equal(expectedLogMessage, collector.
LatestRecord
.Message);
106
Assert.Equal(expectedLogLevel, collector.
LatestRecord
.Level);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (3)
ResourceMonitoringServiceTests.cs (3)
264
Assert.Contains(ProviderUnableToGatherData, logger.Collector.
LatestRecord
.Message, StringComparison.OrdinalIgnoreCase);
292
Assert.Contains(_publisherUnableToPublishErrorMessage, logger.Collector.
LatestRecord
.Message, StringComparison.OrdinalIgnoreCase);
375
await Verifier.Verify(logger.Collector.
LatestRecord
).UseDirectory("Verified");
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogger.cs (1)
101
public FakeLogRecord LatestRecord => Collector.
LatestRecord
;
Microsoft.Gen.Logging.Generated.Tests (349)
DataClassificationTests.cs (2)
22
Assert.Null(collector.
LatestRecord
.Exception);
23
Assert.Equal("M2", collector.
LatestRecord
.Message);
LoggerFromMemberTests.cs (24)
24
Assert.Null(collector.
LatestRecord
.Exception);
25
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
41
Assert.Null(collector.
LatestRecord
.Exception);
42
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
62
Assert.Null(collector.
LatestRecord
.Exception);
63
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
79
Assert.Null(collector.
LatestRecord
.Exception);
80
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
100
Assert.Null(collector.
LatestRecord
.Exception);
101
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
114
Assert.Null(collector.
LatestRecord
.Exception);
115
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
130
Assert.Null(logger.Collector.
LatestRecord
.Exception);
131
Assert.Equal("M1 arg0", logger.Collector.
LatestRecord
.Message);
140
Assert.Null(logger.Collector.
LatestRecord
.Exception);
141
Assert.Equal("M1 arg1", logger.Collector.
LatestRecord
.Message);
143
Assert.Null(logger2.Collector.
LatestRecord
.Exception);
144
Assert.Equal("M0 arg1", logger2.Collector.
LatestRecord
.Message);
157
Assert.Null(collector.
LatestRecord
.Exception);
158
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
174
Assert.Null(collector.
LatestRecord
.Exception);
175
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
179
Assert.Null(collector.
LatestRecord
.Exception);
180
Assert.Equal("M1 arg0", collector.
LatestRecord
.Message);
LoggerMessageAttributeTests.cs (30)
21
Assert.Null(collector.
LatestRecord
.Exception);
22
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
34
Assert.Null(collector.
LatestRecord
.Exception);
35
Assert.Equal("M0 arg0", collector.
LatestRecord
.Message);
47
Assert.Null(collector.
LatestRecord
.Exception);
48
Assert.Equal("M1 ---- arg1", collector.
LatestRecord
.Message);
53
Assert.Null(collector.
LatestRecord
.Exception);
54
Assert.Equal("M2 ---- arg1", collector.
LatestRecord
.Message);
66
Assert.Null(collector.
LatestRecord
.Exception);
67
Assert.Equal("M8 ------", collector.
LatestRecord
.Message);
72
Assert.Null(collector.
LatestRecord
.Exception);
73
Assert.Equal("M9 ----", collector.
LatestRecord
.Message);
78
Assert.Null(collector.
LatestRecord
.Exception);
79
Assert.Equal("M10 ------------------------", collector.
LatestRecord
.Message);
91
Assert.Null(collector.
LatestRecord
.Exception);
92
Assert.Equal("M3 ---- ---- ---- ----", collector.
LatestRecord
.Message);
97
Assert.Null(collector.
LatestRecord
.Exception);
98
Assert.Equal("M4 ---- ---- ---- ------------------------", collector.
LatestRecord
.Message);
110
Assert.Null(collector.
LatestRecord
.Exception);
111
Assert.Equal("M5 ---- ---- ---- ---- ---- ---- ---- ---- ++++ ++++ +++++", collector.
LatestRecord
.Message);
138
Assert.Null(collector.
LatestRecord
.Exception);
139
Assert.Equal("M1 ----", collector.
LatestRecord
.Message);
144
Assert.Null(collector.
LatestRecord
.Exception);
145
Assert.Equal("M2 ---- ---- ----", collector.
LatestRecord
.Message);
156
Assert.Null(collector.
LatestRecord
.Exception);
157
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
158
Assert.Equal(expectedLevel, collector.
LatestRecord
.Level);
159
Assert.NotNull(collector.
LatestRecord
.StructuredState);
160
Assert.Equal(expectedState.Length, collector.
LatestRecord
.StructuredState!.Count);
163
Assert.Contains(collector.
LatestRecord
.StructuredState, x => x.Key == key && x.Value == value);
LogMethodTests.cs (216)
25
Assert.Equal(LogLevel.Critical, collector.
LatestRecord
.Level);
26
Assert.Null(collector.
LatestRecord
.Exception);
27
Assert.Equal("Could not open socket to `microsoft.com`", collector.
LatestRecord
.Message);
32
Assert.Equal(LogLevel.Critical, collector.
LatestRecord
.Level);
33
Assert.Null(collector.
LatestRecord
.Exception);
34
Assert.Equal("Could not open socket to `microsoft.com`", collector.
LatestRecord
.Message);
39
Assert.Equal(LogLevel.Critical, collector.
LatestRecord
.Level);
40
Assert.Null(collector.
LatestRecord
.Exception);
41
Assert.Equal("Could not open socket to `microsoft.com`", collector.
LatestRecord
.Message);
52
Assert.Equal(LogLevel.Critical, collector.
LatestRecord
.Level);
53
Assert.Null(collector.
LatestRecord
.Exception);
54
Assert.Equal("Could not open socket to `microsoft.com`", collector.
LatestRecord
.Message);
90
Assert.Equal("Hello World", collector.
LatestRecord
.Message);
91
Assert.Equal(3, collector.
LatestRecord
.StructuredState!.Count);
92
Assert.Equal("Hello", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
93
Assert.Equal("World", collector.
LatestRecord
.StructuredState!.GetValue("p2"));
98
Assert.Equal("Hello World", collector.
LatestRecord
.Message);
99
Assert.Equal(3, collector.
LatestRecord
.StructuredState!.Count);
100
Assert.Equal("Hello", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
101
Assert.Equal("World", collector.
LatestRecord
.StructuredState!.GetValue("p2"));
112
Assert.Null(collector.
LatestRecord
.Exception);
113
Assert.Equal("M1", collector.
LatestRecord
.Message);
118
Assert.Null(collector.
LatestRecord
.Exception);
119
Assert.Equal("M2 arg1", collector.
LatestRecord
.Message);
124
Assert.Null(collector.
LatestRecord
.Exception);
125
Assert.Equal("M3 arg1 2", collector.
LatestRecord
.Message);
130
Assert.Equal("A", collector.
LatestRecord
.Exception!.Message);
131
Assert.Equal("M4", collector.
LatestRecord
.Message);
136
Assert.Equal("A", collector.
LatestRecord
.Exception!.Message);
137
Assert.Equal("M5 System.InvalidOperationException: B", collector.
LatestRecord
.Message);
142
Assert.Equal("A", collector.
LatestRecord
.Exception!.Message);
143
Assert.Equal("M6 2", collector.
LatestRecord
.Message);
148
Assert.Equal("B", collector.
LatestRecord
.Exception!.Message);
149
Assert.Equal("M7 1", collector.
LatestRecord
.Message);
154
Assert.Equal("M81234567", collector.
LatestRecord
.Message);
159
Assert.Equal("M9 1 2 3 4 5 6 7", collector.
LatestRecord
.Message);
164
Assert.Equal("M101", collector.
LatestRecord
.Message);
223
Assert.Null(collector.
LatestRecord
.Exception);
224
Assert.Equal("M0 Zero", collector.
LatestRecord
.Message);
225
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
226
Assert.Equal(0, collector.
LatestRecord
.Id.Id);
231
Assert.Null(collector.
LatestRecord
.Exception);
232
Assert.Equal("M1 One", collector.
LatestRecord
.Message);
233
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
234
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
239
Assert.Null(collector.
LatestRecord
.Exception);
240
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
241
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
242
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
247
Assert.Null(collector.
LatestRecord
.Exception);
248
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
249
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
250
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
255
Assert.Null(collector.
LatestRecord
.Exception);
256
Assert.Equal("M4 Four", collector.
LatestRecord
.Message);
257
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
258
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
263
Assert.Null(collector.
LatestRecord
.Exception);
264
Assert.Equal("M5 Five", collector.
LatestRecord
.Message);
265
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
266
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
271
Assert.Null(collector.
LatestRecord
.Exception);
272
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
273
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
274
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
281
var logRecord = collector.
LatestRecord
;
292
logRecord = collector.
LatestRecord
;
308
Assert.Null(collector.
LatestRecord
.Exception);
309
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
310
Assert.Equal(LogLevel.Trace, collector.
LatestRecord
.Level);
315
Assert.Null(collector.
LatestRecord
.Exception);
316
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
317
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
322
Assert.Null(collector.
LatestRecord
.Exception);
323
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
324
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
329
Assert.Null(collector.
LatestRecord
.Exception);
330
Assert.Equal("\"Hello\" World", collector.
LatestRecord
.Message);
331
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
336
Assert.Null(collector.
LatestRecord
.Exception);
337
Assert.Equal("\"p\" -> \"q\"", collector.
LatestRecord
.Message);
338
Assert.Equal(LogLevel.Warning, collector.
LatestRecord
.Level);
339
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
344
Assert.Null(collector.
LatestRecord
.Exception);
345
Assert.Equal("\"\n\r\\", collector.
LatestRecord
.Message);
346
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
347
Assert.NotEqual(0, collector.
LatestRecord
.Id.Id);
361
Assert.Null(collector.
LatestRecord
.Exception);
362
Assert.Equal("M0", collector.
LatestRecord
.Message);
363
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
368
Assert.Null(collector.
LatestRecord
.Exception);
369
Assert.Equal("M1 Foo", collector.
LatestRecord
.Message);
370
Assert.Equal(LogLevel.Trace, collector.
LatestRecord
.Level);
377
var logRecord = collector.
LatestRecord
;
403
Assert.Null(collector.
LatestRecord
.Exception);
404
Assert.Equal("M2", collector.
LatestRecord
.Message);
405
Assert.Equal(LogLevel.Information, collector.
LatestRecord
.Level);
410
Assert.Null(collector.
LatestRecord
.Exception);
411
Assert.Equal("M3", collector.
LatestRecord
.Message);
412
Assert.Equal(LogLevel.Warning, collector.
LatestRecord
.Level);
417
Assert.Null(collector.
LatestRecord
.Exception);
418
Assert.Equal("M4", collector.
LatestRecord
.Message);
419
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
424
Assert.Null(collector.
LatestRecord
.Exception);
425
Assert.Equal("M5", collector.
LatestRecord
.Message);
426
Assert.Equal(LogLevel.Critical, collector.
LatestRecord
.Level);
431
Assert.Null(collector.
LatestRecord
.Exception);
432
Assert.Equal("M6", collector.
LatestRecord
.Message);
433
Assert.Equal(LogLevel.None, collector.
LatestRecord
.Level);
438
Assert.Null(collector.
LatestRecord
.Exception);
439
Assert.Equal("M7", collector.
LatestRecord
.Message);
440
Assert.Equal((LogLevel)42, collector.
LatestRecord
.Level);
445
Assert.Null(collector.
LatestRecord
.Exception);
446
Assert.Equal("M8", collector.
LatestRecord
.Message);
447
Assert.Equal(LogLevel.Critical, collector.
LatestRecord
.Level);
452
Assert.Null(collector.
LatestRecord
.Exception);
453
Assert.Equal("M9", collector.
LatestRecord
.Message);
454
Assert.Equal(LogLevel.Information, collector.
LatestRecord
.Level);
459
Assert.Null(collector.
LatestRecord
.Exception);
460
Assert.Equal("M10 Warning", collector.
LatestRecord
.Message);
461
Assert.Equal(LogLevel.Warning, collector.
LatestRecord
.Level);
466
Assert.Null(collector.
LatestRecord
.Exception);
467
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
481
Assert.Null(collector.
LatestRecord
.Exception);
482
Assert.Equal("No params here...", collector.
LatestRecord
.Message);
483
Assert.Equal(LogLevel.Warning, collector.
LatestRecord
.Level);
488
Assert.Null(collector.
LatestRecord
.Exception);
489
Assert.Equal("No params here as well...", collector.
LatestRecord
.Message);
490
Assert.Equal(LogLevel.Information, collector.
LatestRecord
.Level);
495
Assert.Null(collector.
LatestRecord
.Exception);
496
Assert.Equal("No params here as well...", collector.
LatestRecord
.Message);
497
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
509
Assert.Null(collector.
LatestRecord
.Exception);
510
Assert.Equal("M2 --- --- -----", collector.
LatestRecord
.Message);
526
Assert.Equal("Foo", collector.
LatestRecord
.Exception!.Message);
527
Assert.Equal("M0 System.ArgumentException: Bar", collector.
LatestRecord
.Message);
528
Assert.Equal(LogLevel.Trace, collector.
LatestRecord
.Level);
533
Assert.Equal("Foo", collector.
LatestRecord
.Exception!.Message);
534
Assert.Equal("M1 System.ArgumentException: Bar", collector.
LatestRecord
.Message);
535
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
540
Assert.Equal("Foo", collector.
LatestRecord
.Exception!.Message);
541
Assert.Equal("M2 One: System.ArgumentException: Foo", collector.
LatestRecord
.Message);
542
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
549
Assert.NotNull(collector.
LatestRecord
.Exception);
550
Assert.Equal(exception.Message, collector.
LatestRecord
.Exception!.Message);
551
Assert.Equal(exception.GetType(), collector.
LatestRecord
.Exception!.GetType());
552
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
553
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
564
Assert.Null(collector.
LatestRecord
.Exception);
565
Assert.Equal("M0", collector.
LatestRecord
.Message);
566
Assert.Equal(LogLevel.Trace, collector.
LatestRecord
.Level);
568
Assert.Equal("CustomEventName", collector.
LatestRecord
.Id.Name);
574
var logRecord = collector.
LatestRecord
;
590
Assert.Null(collector.
LatestRecord
.Exception);
591
Assert.Equal("M8", collector.
LatestRecord
.Message);
592
Assert.Equal(LogLevel.Error, collector.
LatestRecord
.Level);
597
Assert.Null(collector.
LatestRecord
.Exception);
598
Assert.Equal("M9", collector.
LatestRecord
.Message);
599
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
604
Assert.Null(collector.
LatestRecord
.Exception);
605
Assert.Equal("M10", collector.
LatestRecord
.Message);
606
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
611
Assert.Null(collector.
LatestRecord
.Exception);
612
Assert.Equal("M11", collector.
LatestRecord
.Message);
613
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
618
Assert.Null(collector.
LatestRecord
.Exception);
619
Assert.Equal("M12", collector.
LatestRecord
.Message);
620
Assert.Equal(LogLevel.Debug, collector.
LatestRecord
.Level);
632
Assert.Null(collector.
LatestRecord
.Exception);
633
Assert.Equal("M0 0", collector.
LatestRecord
.Message);
640
Assert.Null(collector.
LatestRecord
.Exception);
641
Assert.Equal("M1 42 42", collector.
LatestRecord
.Message);
648
Assert.Null(collector.
LatestRecord
.Exception);
649
Assert.Equal("M2 42 43 44 45 46 47 48", collector.
LatestRecord
.Message);
662
Assert.Null(collector.
LatestRecord
.Exception);
663
Assert.Equal("M3 43 42", collector.
LatestRecord
.Message);
678
Assert.Null(collector.
LatestRecord
.Exception);
679
Assert.Equal("M0", collector.
LatestRecord
.Message);
692
Assert.Null(collector.
LatestRecord
.Exception);
693
Assert.Equal("M0", collector.
LatestRecord
.Message);
728
Assert.Contains("Hello from S", collector.
LatestRecord
.Message);
754
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("@myevent2"));
755
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("otherevent"));
756
Assert.Equal("UseAtSymbol3, 42 42", collector.
LatestRecord
.Message);
760
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("@myevent3"));
761
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("otherevent"));
762
Assert.Equal("UseAtSymbol4 with error, 42 42", collector.
LatestRecord
.Message);
763
Assert.NotNull(collector.
LatestRecord
.Exception);
767
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("event.class"));
771
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("class"));
775
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("class"));
776
Assert.Equal("M6 class 42", collector.
LatestRecord
.Message);
780
Assert.Equal("42", collector.
LatestRecord
.StructuredState!.GetValue("@param"));
781
Assert.Equal("M7 param 42", collector.
LatestRecord
.Message);
802
Assert.Equal("M0 (null)", collector.
LatestRecord
.Message);
805
Assert.Equal("M1 (null)", collector.
LatestRecord
.Message);
808
Assert.Equal("M3 (null)", collector.
LatestRecord
.Message);
811
Assert.Equal("M4 (null) (null) (null) (null) (null) (null) (null) (null) (null)", collector.
LatestRecord
.Message);
814
Assert.Equal("M5 (null) (null) (null) (null) (null) (null) (null) (null) (null)", collector.
LatestRecord
.Message);
833
Assert.Equal(dt.ToString(CultureInfo.InvariantCulture), collector.
LatestRecord
.StructuredState!.GetValue("p0"));
834
Assert.Equal("M0 " + dt.ToString(CultureInfo.InvariantCulture), collector.
LatestRecord
.Message);
857
Assert.Equal("[\"1\",\"2\",\"3\"]", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
858
Assert.Equal("[\"4\",\"5\",\"6\"]", collector.
LatestRecord
.StructuredState!.GetValue("p2"));
859
Assert.Equal("{\"Seven\"=\"7\",\"Eight\"=\"8\",\"Nine\"=\"9\"}", collector.
LatestRecord
.StructuredState!.GetValue("p3"));
870
Assert.Null(collector.
LatestRecord
.StructuredState!.GetValue("p1"));
875
Assert.Equal("[\"1\",\"2\",\"3\"]", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
880
Assert.Null(collector.
LatestRecord
.StructuredState!.GetValue("class"));
885
Assert.Equal("[\"1\",\"2\",\"3\"]", collector.
LatestRecord
.StructuredState!.GetValue("class"));
890
Assert.Equal("[\"1\",\"2\",\"3\"]", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
897
Assert.Equal("[\"1\",\"2\",\"3\"]", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
902
Assert.Null(collector.
LatestRecord
.StructuredState!.GetValue("p1"));
913
Assert.Equal("Formatted!", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
918
Assert.Equal("Formatted!", collector.
LatestRecord
.StructuredState!.GetValue("p1.P1"));
923
Assert.Equal("Converted!", collector.
LatestRecord
.StructuredState!.GetValue("p1"));
928
var rol = (IReadOnlyList<KeyValuePair<string, string>>)collector.
LatestRecord
.State!;
939
var rol = (collector.
LatestRecord
.State as IReadOnlyList<KeyValuePair<string, string?>>)!;
LogPropertiesRedactionTests.cs (21)
30
Assert.Null(collector.
LatestRecord
.Exception);
31
Assert.Equal("LogProperties with redaction: ----", collector.
LatestRecord
.Message);
40
collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
55
Assert.Null(collector.
LatestRecord
.Exception);
56
Assert.Equal(LogLevel.Information, collector.
LatestRecord
.Level);
57
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
65
collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
79
Assert.Null(collector.
LatestRecord
.Exception);
80
Assert.Equal("No template params", collector.
LatestRecord
.Message);
95
collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
109
Assert.Null(collector.
LatestRecord
.Exception);
110
Assert.Equal(LogLevel.Warning, collector.
LatestRecord
.Level);
111
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
125
collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
139
Assert.Null(collector.
LatestRecord
.Exception);
140
Assert.Equal("Only ----------- as param", collector.
LatestRecord
.Message);
150
collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
164
Assert.Null(collector.
LatestRecord
.Exception);
165
Assert.Equal(LogLevel.None, collector.
LatestRecord
.Level);
166
Assert.Equal(string.Empty, collector.
LatestRecord
.Message);
175
collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
LogPropertiesTests.cs (22)
176
var ss = collector.
LatestRecord
.StructuredState!.ToDictionary(x => x.Key, x => x.Value);
194
ss = collector.
LatestRecord
.StructuredState!.ToDictionary(x => x.Key, x => x.Value);
229
Assert.Equal(LogLevel.Debug, _logger.Collector.
LatestRecord
.Level);
293
_logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
302
Assert.Equal(LogLevel.Information, _logger.Collector.
LatestRecord
.Level);
303
Assert.Equal($"Both {StringProperty} and {classToLog} as params", _logger.Collector.
LatestRecord
.Message);
313
_logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
323
Assert.Equal(LogLevel.Information, _logger.Collector.
LatestRecord
.Level);
324
Assert.Equal($"Testing nullable property within class here...", _logger.Collector.
LatestRecord
.Message);
333
_logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
343
Assert.Equal(LogLevel.Information, _logger.Collector.
LatestRecord
.Level);
344
Assert.Equal($"Testing nullable property within class here...", _logger.Collector.
LatestRecord
.Message);
352
_logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
364
var latestRecord = _logger.Collector.
LatestRecord
;
388
var latestRecord = _logger.Collector.
LatestRecord
;
418
var latestRecord = _logger.Collector.
LatestRecord
;
447
var latestRecord = _logger.Collector.
LatestRecord
;
471
var latestRecord = _logger.Collector.
LatestRecord
;
498
var latestRecord = _logger.Collector.
LatestRecord
;
522
var latestRecord = _logger.Collector.
LatestRecord
;
547
var latestRecord = _logger.Collector.
LatestRecord
;
573
var latestRecord = _logger.Collector.
LatestRecord
;
PrimaryConstructorTests.cs (8)
23
Assert.Null(collector.
LatestRecord
.Exception);
24
Assert.Equal("Test.", collector.
LatestRecord
.Message);
37
Assert.Null(collector.
LatestRecord
.Exception);
38
Assert.Equal("Test.", collector.
LatestRecord
.Message);
51
Assert.Null(collector.
LatestRecord
.Exception);
52
Assert.Equal("Test.", collector.
LatestRecord
.Message);
65
Assert.Null(collector.
LatestRecord
.Exception);
66
Assert.Equal("Test.", collector.
LatestRecord
.Message);
TagNameTests.cs (3)
20
logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(new Dictionary<string, string?>
27
logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(new Dictionary<string, string?>
33
Assert.Equal("0", logger.Collector.
LatestRecord
.Message);
TagProviderTests.cs (19)
33
var latestRecord = _logger.Collector.
LatestRecord
;
56
var latestRecord = _logger.Collector.
LatestRecord
;
81
var latestRecord = _logger.Collector.
LatestRecord
;
104
var latestRecord = _logger.Collector.
LatestRecord
;
125
var latestRecord = _logger.Collector.
LatestRecord
;
136
latestRecord = _logger.Collector.
LatestRecord
;
162
var latestRecord = _logger.Collector.
LatestRecord
;
186
var latestRecord = _logger.Collector.
LatestRecord
;
207
var latestRecord = _logger.Collector.
LatestRecord
;
226
var latestRecord = _logger.Collector.
LatestRecord
;
246
var latestRecord = _logger.Collector.
LatestRecord
;
268
var latestRecord = _logger.Collector.
LatestRecord
;
289
var latestRecord = _logger.Collector.
LatestRecord
;
310
var latestRecord = _logger.Collector.
LatestRecord
;
330
var latestRecord = _logger.Collector.
LatestRecord
;
357
var latestRecord = _logger.Collector.
LatestRecord
;
381
_logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
395
var latestRecord = _logger.Collector.
LatestRecord
;
420
var latestRecord = _logger.Collector.
LatestRecord
;
TransitiveTests.cs (4)
28
logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
38
logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
55
logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);
65
logger.Collector.
LatestRecord
.StructuredState.Should().NotBeNull().And.Equal(expectedState);