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