1 type derived from FakeLogger
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLoggerT.cs (1)
21public sealed class FakeLogger<T> : FakeLogger, ILogger<T>
28 instantiations of FakeLogger
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLoggerProvider.cs (1)
71return _loggers.GetOrAdd(categoryName ?? string.Empty, (name) => new(Collector, name)
Microsoft.Extensions.Diagnostics.Testing.Tests (18)
Logging\FakeLogCollectorTests.cs (3)
41var logger = new FakeLogger(collector); 83var logger = new FakeLogger(collector); 122var logger = new FakeLogger(output.WriteLine, "Storage");
Logging\FakeLoggerTests.cs (15)
28var logger = new FakeLogger(collector); 70var logger = new FakeLogger(); 74logger = new FakeLogger(); 98logger = new FakeLogger(); 102logger = new FakeLogger(); 112var logger = new FakeLogger(); 128var logger = new FakeLogger(); 149var logger = new FakeLogger(); 189var logger = new FakeLogger(collector); 209var logger = new FakeLogger(collector); 232var logger = new FakeLogger(collector, category: null); 235logger = new FakeLogger(collector, "Network"); 238logger = new FakeLogger(collector, "Storage"); 257var logger = new FakeLogger(collector); 275var logger = new FakeLogger();
Microsoft.Extensions.Telemetry.Tests (3)
Logging\ExtendedLoggerFactoryTests.cs (1)
629Logger = new FakeLogger((FakeLogCollector?)null, categoryName);
Logging\ExtendedLoggerTests.cs (1)
856Logger = new FakeLogger((FakeLogCollector?)null, categoryName);
Logging\SerialExtendedLoggerTests.cs (1)
71Logger = new FakeLogger((FakeLogCollector?)null, categoryName);
Microsoft.Gen.Logging.Generated.Tests (6)
LogPropertiesTests.cs (1)
24private readonly FakeLogger _logger = new();
TagNameTests.cs (1)
17var logger = new FakeLogger();
TagProviderTests.cs (1)
17private readonly FakeLogger _logger = new();
TransitiveTests.cs (2)
17var logger = new FakeLogger(); 44var logger = new FakeLogger();
Utils.cs (1)
69var fakeLogger = new FakeLogger();
45 references to FakeLogger
Microsoft.Extensions.Diagnostics.Testing (7)
Logging\FakeLogger.cs (2)
25/// Initializes a new instance of the <see cref="FakeLogger"/> class. 36/// Initializes a new instance of the <see cref="FakeLogger"/> class that copies all log records to the given output sink.
Logging\FakeLoggerProvider.cs (3)
22private readonly ConcurrentDictionary<string, FakeLogger> _loggers = new(); 65/// Creates a new <see cref="FakeLogger"/> instance. 69public FakeLogger CreateLogger(string? categoryName)
Logging\FakeLogRecord.cs (2)
12/// A single log record tracked by <see cref="FakeLogger"/>. 26/// <param name="enabled">Whether the log level was enabled or not when the <see cref="FakeLogger.Log"/> method was called.</param>
Microsoft.Extensions.Diagnostics.Testing.Tests (15)
Logging\FakeLogCollectorTests.cs (3)
41var logger = new FakeLogger(collector); 83var logger = new FakeLogger(collector); 122var logger = new FakeLogger(output.WriteLine, "Storage");
Logging\FakeLoggerProviderTests.cs (2)
16var logger = loggerProvider.CreateLogger("Storage"); 39var l1 = provider.CreateLogger(null);
Logging\FakeLoggerTests.cs (10)
28var logger = new FakeLogger(collector); 70var logger = new FakeLogger(); 112var logger = new FakeLogger(); 128var logger = new FakeLogger(); 149var logger = new FakeLogger(); 189var logger = new FakeLogger(collector); 209var logger = new FakeLogger(collector); 232var logger = new FakeLogger(collector, category: null); 257var logger = new FakeLogger(collector); 275var logger = new FakeLogger();
Microsoft.Extensions.Hosting.Testing (1)
FakeHostBuilder.cs (1)
40.TryAddSingleton<ILogger, FakeLogger>();
Microsoft.Extensions.Hosting.Testing.Tests (1)
FakeHostBuilderTests.cs (1)
48Assert.IsType<FakeLogger>(hostBuilderServices.GetService<ILogger>());
Microsoft.Extensions.Telemetry.Tests (11)
Logging\ExtendedLoggerFactoryTests.cs (1)
625public FakeLogger? Logger { get; private set; }
Logging\ExtendedLoggerTests.cs (8)
70var sink = provider.Logger!; 155var sink = provider.Logger!; 220var sink = provider.Logger!; 280var sink = provider.Logger!; 321var fake = provider.Logger!; 349var sink = provider.Logger!; 458var sink = provider.Logger!; 852public FakeLogger? Logger { get; private set; }
Logging\SerialExtendedLoggerTests.cs (2)
57var sink = provider.Logger!; 67public FakeLogger? Logger { get; private set; }
Microsoft.Gen.Logging.Generated.Tests (10)
LogMethodTests.cs (2)
63var fakeLogger = logger.FakeLogger; 703var fakeLogger = logger.FakeLogger;
LogPropertiesTests.cs (1)
24private readonly FakeLogger _logger = new();
TagNameTests.cs (1)
17var logger = new FakeLogger();
TagProviderTests.cs (1)
17private readonly FakeLogger _logger = new();
TransitiveTests.cs (2)
17var logger = new FakeLogger(); 44var logger = new FakeLogger();
Utils.cs (3)
43public TestLogger(ILogger logger, ServiceProvider serviceProvider, FakeLogger fakeLogger) 52public FakeLogger FakeLogger { get; } 69var fakeLogger = new FakeLogger();