34 references to LatestRecord
Microsoft.Extensions.Diagnostics.Testing.Tests (28)
Logging\FakeLoggerProviderTests.cs (3)
20
Assert.Equal("Storage", logger.
LatestRecord
.Category);
26
Assert.Null(logger.
LatestRecord
.Category);
32
Assert.Equal("Microsoft.Extensions.Logging.Testing.Test.Logging.FakeLoggerProviderTests", logger.
LatestRecord
.Category);
Logging\FakeLoggerTests.cs (25)
53
Assert.Equal("World", logger.
LatestRecord
.Message);
54
Assert.Equal(LogLevel.Error, logger.
LatestRecord
.Level);
55
Assert.Null(logger.
LatestRecord
.Exception);
56
Assert.Null(logger.
LatestRecord
.Category);
58
Assert.Empty(logger.
LatestRecord
.Scopes);
59
Assert.Equal(0, logger.
LatestRecord
.Id.Id);
64
Assert.Throws<InvalidOperationException>(() => logger.
LatestRecord
.Level);
72
Assert.Equal("42", (string)logger.
LatestRecord
.State!);
88
var ss = logger.
LatestRecord
.StructuredState!.ToDictionary(x => x.Key, x => x.Value);
94
Assert.Equal("V0", logger.
LatestRecord
.GetStructuredStateValue("K0"));
95
Assert.Equal("V1", logger.
LatestRecord
.GetStructuredStateValue("K1"));
96
Assert.Equal("[\"0\",\"1\",\"2\"]", logger.
LatestRecord
.GetStructuredStateValue("K3"));
100
Assert.Null(logger.
LatestRecord
.State);
104
ss = logger.
LatestRecord
.StructuredState!.ToDictionary(x => x.Key, x => x.Value);
115
Assert.Null(logger.
LatestRecord
.GetStructuredStateValue("K0"));
130
Assert.Equal(dt.ToString(CultureInfo.InvariantCulture), (string)logger.
LatestRecord
.State!);
138
Assert.Equal(dt.ToString(CultureInfo.InvariantCulture), logger.
LatestRecord
.StructuredState![0].Value!);
172
Assert.False(logger.
LatestRecord
.LevelEnabled);
178
Assert.True(logger.
LatestRecord
.LevelEnabled);
196
Assert.Equal("BEFORE", logger.
LatestRecord
.Message);
218
Assert.Equal("M4", logger.
LatestRecord
.Message);
242
Assert.Equal("M2", logger.
LatestRecord
.Message);
282
Assert.Equal(2, logger.
LatestRecord
.Scopes.Count);
283
Assert.Equal(42, (int)logger.
LatestRecord
.Scopes[0]!);
284
Assert.Equal("Hello World", (string)logger.
LatestRecord
.Scopes[1]!);
Microsoft.Extensions.Hosting.Testing.Tests (2)
HostTerminatorServiceTests.cs (2)
48
logger.
LatestRecord
.Message);
64
logger.
LatestRecord
.Message);
Microsoft.Gen.Logging.Generated.Tests (4)
LogPropertiesTests.cs (4)
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!;