145 references to StructuredState
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (29)
Logging\AcceptanceTests.cs (23)
184
var state = logCollector.LatestRecord.
StructuredState
!;
244
var state = logCollector.LatestRecord.
StructuredState
!;
310
var requestState = logRecords[0].
StructuredState
;
311
var requestBodyState = logRecords[1].
StructuredState
;
312
var responseState = logRecords[2].
StructuredState
;
313
var responseBodyState = logRecords[3].
StructuredState
;
314
var durationState = logRecords[4].
StructuredState
;
372
var state = lastRecord.
StructuredState
;
418
var state = logCollector.LatestRecord.
StructuredState
;
460
var state = logCollector.LatestRecord.
StructuredState
;
491
var firstState = logRecords[0].
StructuredState
;
492
var secondState = logRecords[1].
StructuredState
;
529
var firstRecord = logRecords[0].
StructuredState
;
530
var secondRecord = logRecords[1].
StructuredState
;
531
var thirdRecord = logRecords[2].
StructuredState
;
532
var fourthRecord = logRecords[3].
StructuredState
;
533
var fithRecord = logRecords[4].
StructuredState
;
534
var sixthRecord = logRecords[5].
StructuredState
;
577
var state = logCollector.LatestRecord.
StructuredState
;
618
var state = logCollector.LatestRecord.
StructuredState
;
652
var state = logCollector.LatestRecord.
StructuredState
;
712
Assert.Equal(7, logCollector.GetSnapshot()[0].
StructuredState
!.Count);
752
Assert.Equal(7, logCollector.GetSnapshot()[1].
StructuredState
!.Count);
Logging\AcceptanceTests.Mvc.cs (5)
78
var state = logRecord.
StructuredState
!;
113
var state = logRecord.
StructuredState
!;
159
var state = logRecord.
StructuredState
!;
203
var state = logRecord.
StructuredState
!;
244
var state = logRecord.
StructuredState
!;
Logging\AcceptanceTests.Routing.cs (1)
78
var state = logRecord.
StructuredState
!;
Microsoft.Extensions.Diagnostics.Testing (2)
Logging\FakeLogRecord.cs (2)
80
if (
StructuredState
is not null)
82
foreach (var kvp in
StructuredState
)
Microsoft.Extensions.Diagnostics.Testing.Tests (3)
Logging\FakeLoggerTests.cs (3)
88
var ss = logger.LatestRecord.
StructuredState
!.ToDictionary(x => x.Key, x => x.Value);
104
ss = logger.LatestRecord.
StructuredState
!.ToDictionary(x => x.Key, x => x.Value);
138
Assert.Equal(dt.ToString(CultureInfo.InvariantCulture), logger.LatestRecord.
StructuredState
![0].Value!);
Microsoft.Extensions.Http.Diagnostics.Tests (12)
Logging\AcceptanceTests.cs (9)
125
var state = logRecord.
StructuredState
;
173
var state = logRecord.
StructuredState
;
189
state = logRecord.
StructuredState
;
259
var state = logRecord.
StructuredState
;
281
state = logRecord.
StructuredState
;
324
var state = logRecord.
StructuredState
;
367
var state = logRecord.
StructuredState
;
436
var state = logRecord.
StructuredState
;
697
var state = logRecord.
StructuredState
;
Logging\Internal\LogRecordExtensions.cs (3)
17
Assert.NotNull(logRecord.
StructuredState
);
18
Assert.NotEmpty(logRecord.
StructuredState
);
19
return logRecord.
StructuredState
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
Microsoft.Extensions.Telemetry.Tests (1)
Logging\ExtendedLoggerTests.cs (1)
506
var state = snap[3].
StructuredState
;
Microsoft.Gen.Logging.Generated.Tests (98)
LoggerMessageAttributeTests.cs (3)
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 (35)
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"));
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"));
381
Assert.NotNull(logRecord.
StructuredState
);
382
Assert.Single(logRecord.
StructuredState
!);
383
Assert.Equal("p1", logRecord.
StructuredState
![0].Key);
384
Assert.Equal("param", logRecord.
StructuredState
[0].Value);
740
Assert.NotNull(record.
StructuredState
);
741
Assert.Contains(record.
StructuredState
, x => x.Key == "event");
742
Assert.DoesNotContain(record.
StructuredState
, x => x.Key == "@event");
754
Assert.Equal("42", collector.LatestRecord.
StructuredState
!.GetValue("@myevent2"));
755
Assert.Equal("42", collector.LatestRecord.
StructuredState
!.GetValue("otherevent"));
760
Assert.Equal("42", collector.LatestRecord.
StructuredState
!.GetValue("@myevent3"));
761
Assert.Equal("42", collector.LatestRecord.
StructuredState
!.GetValue("otherevent"));
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"));
780
Assert.Equal("42", collector.LatestRecord.
StructuredState
!.GetValue("@param"));
833
Assert.Equal(dt.ToString(CultureInfo.InvariantCulture), collector.LatestRecord.
StructuredState
!.GetValue("p0"));
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"));
LogPropertiesRedactionTests.cs (6)
40
collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
65
collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
95
collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
125
collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
150
collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
175
collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
LogPropertiesTests.cs (19)
45
var ss = _logger.LatestRecord.
StructuredState
!.ToDictionary(x => x.Key, x => x.Value);
62
var state = _logger.LatestRecord.
StructuredState
!;
79
var state = _logger.LatestRecord.
StructuredState
!;
117
var state = _logger.LatestRecord.
StructuredState
!;
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);
293
_logger.Collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
313
_logger.Collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
333
_logger.Collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
352
_logger.Collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
377
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
407
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
437
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
460
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
482
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
511
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
536
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
562
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
588
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
SensitiveRecordTests.cs (10)
21
Assert.NotNull(logRecord.
StructuredState
);
22
Assert.All(logRecord.
StructuredState
, x => Assert.DoesNotContain(SensitiveRecordExtensions.Sensitive, x.Value));
33
Assert.NotNull(logRecord.
StructuredState
);
34
Assert.All(logRecord.
StructuredState
, x => Assert.DoesNotContain(SensitiveRecordExtensions.Sensitive, x.Value));
50
Assert.NotNull(logRecord.
StructuredState
);
51
Assert.All(logRecord.
StructuredState
, x => Assert.DoesNotContain(SensitiveRecordExtensions.Sensitive, x.Value));
67
Assert.NotNull(logRecord.
StructuredState
);
68
Assert.All(logRecord.
StructuredState
, x => Assert.DoesNotContain(SensitiveRecordExtensions.Sensitive, x.Value));
84
Assert.NotNull(logRecord.
StructuredState
);
85
Assert.All(logRecord.
StructuredState
, x => Assert.DoesNotContain(SensitiveRecordExtensions.Sensitive, x.Value));
TagNameTests.cs (2)
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?>
TagProviderTests.cs (19)
44
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
69
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
94
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
116
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
130
Assert.Empty(latestRecord.
StructuredState
!);
147
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
166
var state = latestRecord.
StructuredState
!;
192
var state = latestRecord.
StructuredState
!;
217
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
236
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
258
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
279
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
300
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
320
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
344
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
371
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
381
_logger.Collector.LatestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
408
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
432
latestRecord.
StructuredState
.Should().NotBeNull().And.Equal(expectedState);
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);