11 instantiations of FakeLogCollector
Microsoft.Extensions.Diagnostics.Testing (3)
Logging\FakeLogCollector.cs (1)
46return new FakeLogCollector(Options.Options.Create(Throw.IfNull(options)));
Logging\FakeLogger.cs (1)
31Collector = collector ?? new();
Logging\FakeLoggerProvider.cs (1)
31Collector = collector ?? new FakeLogCollector();
Microsoft.Extensions.Diagnostics.Testing.Tests (3)
Logging\FakeLogCollectorTests.cs (3)
82var collector = new FakeLogCollector(Microsoft.Extensions.Options.Options.Create(options)); 113Assert.Throws<ArgumentNullException>(() => new FakeLogCollector(null!)); 114Assert.Throws<ArgumentException>(() => new FakeLogCollector(Microsoft.Extensions.Options.Options.Create((FakeLogCollectorOptions)null!)));
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Logging\HttpClientLoggerTest.cs (5)
308new FakeLogCollector( 414var fakeLogger = new FakeLogger<HttpClientLogger>(new FakeLogCollector(Options.Options.Create(new FakeLogCollectorOptions()))); 511new FakeLogCollector( 624var fakeLogger = new FakeLogger<HttpClientLogger>(new FakeLogCollector(Options.Options.Create(new FakeLogCollectorOptions()))); 894var fakeLogger = new FakeLogger<HttpClientLogger>(new FakeLogCollector(Options.Options.Create(new FakeLogCollectorOptions())));
127 references to FakeLogCollector
Aspire.Hosting.Containers.Tests (1)
WithDockerfileTests.cs (1)
78var collector = app.Services.GetFakeLogCollector();
Aspire.Hosting.Tests (2)
Codespaces\CodespacesUrlRewriterTests.cs (1)
37var collector = app.Services.GetFakeLogCollector();
HealthCheckTests.cs (1)
124var collector = app.Services.GetFakeLogCollector();
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
114var logCollector = app.Services.GetFakeLogCollector();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Logging\AcceptanceTests.cs (4)
99private static Task RunAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func) 105Func<FakeLogCollector, HttpClient, IServiceProvider, Task> func) 127var logCollector = host.Services.GetFakeLogCollector(); 135private static async Task WaitForLogRecordsAsync(FakeLogCollector logCollector, TimeSpan timeout, int expectedRecords = 1)
Logging\AcceptanceTests.Mvc.cs (1)
51private static Task RunControllerAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (1)
TelemetryHealthChecksPublisherTests.cs (1)
92var collector = logger.Collector;
Microsoft.Extensions.Diagnostics.Testing (17)
Logging\FakeLogCollector.cs (4)
23/// Initializes a new instance of the <see cref="FakeLogCollector"/> class. 32/// Initializes a new instance of the <see cref="FakeLogCollector"/> class. 40/// Creates a new instance of the <see cref="FakeLogCollector"/> class. 44public static FakeLogCollector Create(FakeLogCollectorOptions options)
Logging\FakeLogCollectorDebugView.cs (2)
14private readonly FakeLogCollector _collector; 16public FakeLogCollectorDebugView(FakeLogCollector collector)
Logging\FakeLogger.cs (3)
29public FakeLogger(FakeLogCollector? collector = null, string? category = null) 41: this(FakeLogCollector.Create(new FakeLogCollectorOptions { OutputSink = outputSink }), category) 92public FakeLogCollector Collector { get; }
Logging\FakeLoggerBuilderExtensions.cs (2)
32_ = builder.Services.AddSingleton<FakeLogCollector>(); 50_ = builder.Services.AddSingleton<FakeLogCollector>();
Logging\FakeLoggerProvider.cs (2)
29public FakeLoggerProvider(FakeLogCollector? collector = null) 89public FakeLogCollector Collector { get; }
Logging\FakeLoggerServiceProviderExtensions.cs (2)
20public static FakeLogCollector GetFakeLogCollector(this IServiceProvider services) 21=> services.GetService<FakeLogCollector>() ?? throw new InvalidOperationException("No fake log collector registered");
Logging\FakeLoggerT.cs (2)
29public FakeLogger(FakeLogCollector? collector = null) 39: this(FakeLogCollector.Create(new FakeLogCollectorOptions { OutputSink = outputSink }))
Microsoft.Extensions.Diagnostics.Testing.Tests (16)
Logging\FakeLogCollectorTests.cs (3)
40var collector = FakeLogCollector.Create(options); 82var collector = new FakeLogCollector(Microsoft.Extensions.Options.Options.Create(options));
Logging\FakeLoggerExtensionsTests.cs (3)
23var collector = serviceProvider.GetFakeLogCollector(); 39var collector = serviceProvider.GetFakeLogCollector(); 67var collector = serviceProvider.GetFakeLogCollector();
Logging\FakeLoggerTests.cs (10)
27var collector = FakeLogCollector.Create(options); 188var collector = FakeLogCollector.Create(options); 208var collector = FakeLogCollector.Create(options); 230var collector = FakeLogCollector.Create(options); 255var collector = FakeLogCollector.Create(options);
Microsoft.Extensions.Hosting.Testing (1)
FakeHostingExtensions.cs (1)
52public static FakeLogCollector GetFakeLogCollector(this IHost host)
Microsoft.Extensions.Hosting.Testing.Tests (2)
FakeHostBuilderTests.cs (2)
47Assert.NotNull(hostBuilderServices.GetService<FakeLogCollector>()); 56Assert.Null(hostBuilderServices.GetService<FakeLogCollector>());
Microsoft.Extensions.Http.Diagnostics.Tests (12)
Logging\AcceptanceTests.cs (12)
41var collector = sp.GetFakeLogCollector(); 72var collector = sp.GetFakeLogCollector(); 114var collector = sp.GetFakeLogCollector(); 171var collector = provider.GetFakeLogCollector(); 252var collector = provider.GetFakeLogCollector(); 322var collector = sp.GetFakeLogCollector(); 365var collector = sp.GetFakeLogCollector(); 434var collector = sp.GetFakeLogCollector(); 594var collector = provider.GetFakeLogCollector(); 620var collector = provider.GetFakeLogCollector(); 643var collector = provider.GetFakeLogCollector(); 695var collector = provider.GetFakeLogCollector();
Microsoft.Extensions.Telemetry.Tests (10)
Logging\ExtendedLoggerFactoryTests.cs (1)
629Logger = new FakeLogger((FakeLogCollector?)null, categoryName);
Logging\ExtendedLoggerTests.cs (7)
71var collector = sink.Collector; 156var collector = sink.Collector; 221var collector = sink.Collector; 281var collector = sink.Collector; 350var collector = sink.Collector; 459var collector = sink.Collector; 856Logger = new FakeLogger((FakeLogCollector?)null, categoryName);
Logging\SerialExtendedLoggerTests.cs (2)
58var collector = sink.Collector; 71Logger = new FakeLogger((FakeLogCollector?)null, categoryName);
Microsoft.Gen.Logging.Generated.Tests (59)
DataClassificationTests.cs (1)
18var collector = logger.FakeLogCollector;
LoggerFromMemberTests.cs (8)
16var collector = logger.FakeLogCollector; 33var collector = logger.FakeLogCollector; 54var collector = logger.FakeLogCollector; 71var collector = logger.FakeLogCollector; 92var collector = logger.Collector; 109var collector = logger.Collector; 152var collector = logger.Collector; 166var collector = logger.Collector;
LoggerMessageAttributeTests.cs (9)
17var collector = logger.FakeLogCollector; 30var collector = logger.FakeLogCollector; 43var collector = logger.FakeLogCollector; 62var collector = logger.FakeLogCollector; 87var collector = logger.FakeLogCollector; 106var collector = logger.FakeLogCollector; 119var collector = logger.FakeLogCollector; 134var collector = logger.FakeLogCollector; 153private static void AssertWhenDefaultLogMethodCtor(FakeLogCollector collector, LogLevel expectedLevel, params (string key, string value)[] expectedState)
LogMethodTests.cs (29)
22var collector = logger.FakeLogCollector; 49var collector = logger.FakeLogCollector; 62var collector = logger.FakeLogCollector; 86var collector = logger.FakeLogCollector; 108var collector = logger.FakeLogCollector; 172var collector = logger.FakeLogCollector; 219var collector = logger.FakeLogCollector; 304var collector = logger.FakeLogCollector; 355var collector = logger.FakeLogCollector; 391var collector = logger.FakeLogCollector; 475var collector = logger.FakeLogCollector; 505var collector = logger.FakeLogCollector; 522var collector = logger.FakeLogCollector; 560var collector = logger.FakeLogCollector; 586var collector = logger.FakeLogCollector; 628var collector = logger.FakeLogCollector; 674var collector = logger.FakeLogCollector; 688var collector = logger.FakeLogCollector; 702var collector = logger.FakeLogCollector; 723var collector = logger.FakeLogCollector; 735var collector = logger.FakeLogCollector; 788var collector = logger.FakeLogCollector; 799var collector = logger.FakeLogCollector; 825var collector = logger.FakeLogCollector; 843var collector = logger.FakeLogCollector; 866var collector = logger.FakeLogCollector; 909var collector = logger.FakeLogCollector; 926private static void AssertLastState(FakeLogCollector collector, params KeyValuePair<string, string?>[] expected) 937private static void TestCollection(int expected, FakeLogCollector collector)
LogPropertiesRedactionTests.cs (6)
22var collector = logger.FakeLogCollector; 47var collector = logger.FakeLogCollector; 72var collector = logger.FakeLogCollector; 102var collector = logger.FakeLogCollector; 132var collector = logger.FakeLogCollector; 157var collector = logger.FakeLogCollector;
LogPropertiesTests.cs (1)
156var collector = logger.FakeLogCollector;
PrimaryConstructorTests.cs (4)
19var collector = logger.FakeLogCollector; 33var collector = logger.FakeLogCollector; 47var collector = logger.FakeLogCollector; 61var collector = logger.FakeLogCollector;
Utils.cs (1)
51public FakeLogCollector FakeLogCollector { get; }