1 write to Collector
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogger.cs (1)
31Collector = collector ?? new();
160 references to Collector
Aspire.Hosting.Tests (13)
ResourceNotificationTests.cs (13)
304var logs = logger.Collector.GetSnapshot(); 310logger.Collector.Clear(); 315logs = logger.Collector.GetSnapshot(); 320logger.Collector.Clear(); 325logs = logger.Collector.GetSnapshot(); 330logger.Collector.Clear(); 335logs = logger.Collector.GetSnapshot(); 340logger.Collector.Clear(); 345logs = logger.Collector.GetSnapshot(); 350logger.Collector.Clear(); 355logs = logger.Collector.GetSnapshot(); 360logger.Collector.Clear(); 375var logs = logger.Collector.GetSnapshot();
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 (1)
TelemetryHealthChecksPublisherTests.cs (1)
92var collector = logger.Collector;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (6)
Linux\LinuxUtilizationProviderTests.cs (1)
191var logRecords = logger.Collector.GetSnapshot();
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");
Windows\WindowsContainerSnapshotProviderTests.cs (1)
323var logRecords = _logger.Collector.GetSnapshot();
Windows\WindowsSnapshotProviderTests.cs (1)
67var logRecords = _fakeLogger.Collector.GetSnapshot();
Microsoft.Extensions.Diagnostics.Testing (3)
Logging\FakeLogger.cs (3)
71l.ToArray(), Category, !_disabledLevels.ContainsKey(logLevel), Collector.TimeProvider.GetUtcNow()); 72Collector.AddRecord(record); 101public FakeLogRecord LatestRecord => Collector.LatestRecord;
Microsoft.Extensions.Diagnostics.Testing.Tests (18)
Logging\FakeLoggerProviderTests.cs (6)
17Assert.Equal(logger.Collector, loggerProvider.Collector); 19Assert.Equal(1, logger.Collector.Count); 23Assert.Equal(logger.Collector, loggerProvider.Collector); 25Assert.Equal(2, logger.Collector.Count); 29Assert.Equal(logger.Collector, loggerProvider.Collector); 31Assert.Equal(3, logger.Collector.Count);
Logging\FakeLoggerTests.cs (12)
32var records = logger.Collector.GetSnapshot(); 34Assert.Equal(2, logger.Collector.Count); 61logger.Collector.Clear(); 62Assert.Equal(0, logger.Collector.Count); 63Assert.Empty(logger.Collector.GetSnapshot()); 86Assert.Equal(1, logger.Collector.Count); 171Assert.Equal(1, logger.Collector.Count); 177Assert.Equal(2, logger.Collector.Count); 195Assert.Equal(1, logger.Collector.Count); 217Assert.Equal(1, logger.Collector.Count); 241Assert.Equal(1, logger.Collector.Count); 281Assert.Equal(1, logger.Collector.Count);
Microsoft.Extensions.Hosting.Testing.Tests (1)
HostTerminatorServiceTests.cs (1)
27Assert.Empty(logger.Collector.GetSnapshot());
Microsoft.Extensions.Http.Diagnostics.Tests (12)
Logging\HttpClientLoggerTest.cs (12)
240var logRecords = fakeLogger.Collector.GetSnapshot(); 336var logRecords = fakeLogger.Collector.GetSnapshot(); 439var logRecords = fakeLogger.Collector.GetSnapshot(); 556var logRecords = fakeLogger.Collector.GetSnapshot(); 646var logRecords = fakeLogger.Collector.GetSnapshot(); 696var logRecords = fakeLogger.Collector.GetSnapshot(); 739var logRecords = fakeLogger.Collector.GetSnapshot(); 777var logRecords = fakeLogger.Collector.GetSnapshot(); 822var logRecords = fakeLogger.Collector.GetSnapshot(); 920var logRecords = fakeLogger.Collector.GetSnapshot(); 966var logRecord = fakeLogger.Collector.GetSnapshot().Single(); 986var logRecords = fakeLogger.Collector.GetSnapshot();
Microsoft.Extensions.Telemetry.Tests (7)
Logging\ExtendedLoggerTests.cs (6)
71var collector = sink.Collector; 156var collector = sink.Collector; 221var collector = sink.Collector; 281var collector = sink.Collector; 350var collector = sink.Collector; 459var collector = sink.Collector;
Logging\SerialExtendedLoggerTests.cs (1)
58var collector = sink.Collector;
Microsoft.Gen.Logging.Generated.Tests (96)
LoggerFromMemberTests.cs (14)
92var collector = logger.Collector; 109var collector = logger.Collector; 127Assert.Equal(0, logger.Collector.Count); 130Assert.Null(logger.Collector.LatestRecord.Exception); 131Assert.Equal("M1 arg0", logger.Collector.LatestRecord.Message); 132Assert.Equal(1, logger.Collector.Count); 140Assert.Null(logger.Collector.LatestRecord.Exception); 141Assert.Equal("M1 arg1", logger.Collector.LatestRecord.Message); 142Assert.Equal(2, logger.Collector.Count); 143Assert.Null(logger2.Collector.LatestRecord.Exception); 144Assert.Equal("M0 arg1", logger2.Collector.LatestRecord.Message); 145Assert.Equal(1, logger2.Collector.Count); 152var collector = logger.Collector; 166var collector = logger.Collector;
LogPropertiesTests.cs (34)
43Assert.Equal(1, _logger.Collector.Count); 228Assert.Equal(1, _logger.Collector.Count); 229Assert.Equal(LogLevel.Debug, _logger.Collector.LatestRecord.Level); 293_logger.Collector.LatestRecord.StructuredState.Should().NotBeNull().And.Equal(expectedState); 301Assert.Equal(1, _logger.Collector.Count); 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); 322Assert.Equal(1, _logger.Collector.Count); 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); 342Assert.Equal(1, _logger.Collector.Count); 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); 363Assert.Equal(1, _logger.Collector.Count); 364var latestRecord = _logger.Collector.LatestRecord; 387Assert.Equal(1, _logger.Collector.Count); 388var latestRecord = _logger.Collector.LatestRecord; 417Assert.Equal(1, _logger.Collector.Count); 418var latestRecord = _logger.Collector.LatestRecord; 445Assert.Equal(1, _logger.Collector.Count); 447var latestRecord = _logger.Collector.LatestRecord; 470Assert.Equal(1, _logger.Collector.Count); 471var latestRecord = _logger.Collector.LatestRecord; 497Assert.Equal(1, _logger.Collector.Count); 498var latestRecord = _logger.Collector.LatestRecord; 521Assert.Equal(1, _logger.Collector.Count); 522var latestRecord = _logger.Collector.LatestRecord; 546Assert.Equal(1, _logger.Collector.Count); 547var latestRecord = _logger.Collector.LatestRecord; 572Assert.Equal(1, _logger.Collector.Count); 573var latestRecord = _logger.Collector.LatestRecord;
TagNameTests.cs (4)
20logger.Collector.LatestRecord.StructuredState.Should().NotBeNull().And.Equal(new Dictionary<string, string?> 25logger.Collector.Clear(); 27logger.Collector.LatestRecord.StructuredState.Should().NotBeNull().And.Equal(new Dictionary<string, string?> 33Assert.Equal("0", logger.Collector.LatestRecord.Message);
TagProviderTests.cs (39)
31Assert.Equal(1, _logger.Collector.Count); 33var latestRecord = _logger.Collector.LatestRecord; 55Assert.Equal(1, _logger.Collector.Count); 56var latestRecord = _logger.Collector.LatestRecord; 80Assert.Equal(1, _logger.Collector.Count); 81var latestRecord = _logger.Collector.LatestRecord; 103Assert.Equal(1, _logger.Collector.Count); 104var latestRecord = _logger.Collector.LatestRecord; 124Assert.Equal(1, _logger.Collector.Count); 125var latestRecord = _logger.Collector.LatestRecord; 132_logger.Collector.Clear(); 135Assert.Equal(1, _logger.Collector.Count); 136latestRecord = _logger.Collector.LatestRecord; 161Assert.Equal(1, _logger.Collector.Count); 162var latestRecord = _logger.Collector.LatestRecord; 185Assert.Equal(1, _logger.Collector.Count); 186var latestRecord = _logger.Collector.LatestRecord; 205Assert.Equal(1, _logger.Collector.Count); 207var latestRecord = _logger.Collector.LatestRecord; 225Assert.Equal(1, _logger.Collector.Count); 226var latestRecord = _logger.Collector.LatestRecord; 245Assert.Equal(1, _logger.Collector.Count); 246var latestRecord = _logger.Collector.LatestRecord; 267Assert.Equal(1, _logger.Collector.Count); 268var latestRecord = _logger.Collector.LatestRecord; 288Assert.Equal(1, _logger.Collector.Count); 289var latestRecord = _logger.Collector.LatestRecord; 309Assert.Equal(1, _logger.Collector.Count); 310var latestRecord = _logger.Collector.LatestRecord; 329Assert.Equal(1, _logger.Collector.Count); 330var latestRecord = _logger.Collector.LatestRecord; 356Assert.Equal(1, _logger.Collector.Count); 357var latestRecord = _logger.Collector.LatestRecord; 378Assert.Equal(2, _logger.Collector.Count); 381_logger.Collector.LatestRecord.StructuredState.Should().NotBeNull().And.Equal(expectedState); 393Assert.Equal(1, _logger.Collector.Count); 395var latestRecord = _logger.Collector.LatestRecord; 418Assert.Equal(1, _logger.Collector.Count); 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);
Utils.cs (1)
48FakeLogCollector = fakeLogger.Collector;