475 instantiations of ServiceCollection
Aspire.Cli.Tests (1)
Utils\CliTestHelper.cs (1)
49var services = new ServiceCollection();
Aspire.Dashboard.Tests (2)
Model\AIAssistant\AIContextProviderTests.cs (1)
126new ServiceCollection().BuildServiceProvider(),
Telemetry\TelemetryLoggerProviderTests.cs (1)
20var serviceProvider = new ServiceCollection()
Aspire.EndToEnd.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
505var services = new ServiceCollection();
Aspire.Hosting.Azure.Tests (9)
ProvisioningContextProviderTests.cs (9)
319Services = new ServiceCollection().BuildServiceProvider() 331Services = new ServiceCollection().BuildServiceProvider() 390Services = new ServiceCollection().BuildServiceProvider() 399Services = new ServiceCollection().BuildServiceProvider(), 481Services = new ServiceCollection().BuildServiceProvider() 493Services = new ServiceCollection().BuildServiceProvider() 502Services = new ServiceCollection().BuildServiceProvider() 700Services = new ServiceCollection().BuildServiceProvider() 803Services = new ServiceCollection().BuildServiceProvider()
Aspire.Hosting.DevTunnels.Tests (1)
DevTunnelCliVersionValidationTests.cs (1)
30var services = new ServiceCollection()
Aspire.Hosting.Testing.Tests (3)
DistributedApplicationHttpClientExtensionsForTests.cs (2)
31var services = new ServiceCollection(); 43var services = new ServiceCollection();
ResourceLoggerForwarderServiceTests.cs (1)
146return new ResourceNotificationService(NullLogger<ResourceNotificationService>.Instance, hostApplicationLifetime, new ServiceCollection().BuildServiceProvider(), resourceLoggerService);
Aspire.Hosting.Tests (41)
ApplicationModel\Docker\DockerfileBuilderCallbackAnnotationTests.cs (6)
55var services = new ServiceCollection().BuildServiceProvider(); 82var services = new ServiceCollection().BuildServiceProvider(); 109var services = new ServiceCollection().BuildServiceProvider(); 137var services = new ServiceCollection() 185var services = new ServiceCollection().BuildServiceProvider(); 220var services = new ServiceCollection().BuildServiceProvider();
ApplicationModel\Docker\DockerfileBuilderCallbackContextTests.cs (7)
20var services = new ServiceCollection().BuildServiceProvider(); 36var services = new ServiceCollection().BuildServiceProvider(); 47var services = new ServiceCollection().BuildServiceProvider(); 70var services = new ServiceCollection().BuildServiceProvider(); 93var services = new ServiceCollection().BuildServiceProvider(); 111var services = new ServiceCollection() 130var services = new ServiceCollection().BuildServiceProvider();
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (1)
18var services = new ServiceCollection();
Dashboard\DashboardServiceTests.cs (8)
231new ServiceCollection().BuildServiceProvider(), 301new ServiceCollection().BuildServiceProvider(), 348new ServiceCollection().BuildServiceProvider(), 407new ServiceCollection().BuildServiceProvider(), 444new ServiceCollection().BuildServiceProvider(), 592new ServiceCollection().BuildServiceProvider(), 599new ResourceCommandService(resourceNotificationService, resourceLoggerService, new ServiceCollection().BuildServiceProvider()), 605return new ResourceNotificationService(NullLogger<ResourceNotificationService>.Instance, new TestHostApplicationLifetime(), new ServiceCollection().BuildServiceProvider(), resourceLoggerService);
InteractionServiceTests.cs (4)
218new ServiceCollection().BuildServiceProvider(), 245new ServiceCollection().BuildServiceProvider(), 267new ServiceCollection().BuildServiceProvider(), 1078new ServiceCollection().BuildServiceProvider(),
Orchestrator\ApplicationOrchestratorTests.cs (2)
465var services = new ServiceCollection(); 502new ServiceCollection().BuildServiceProvider(),
Orchestrator\ParameterProcessorTests.cs (2)
1153new ServiceCollection().BuildServiceProvider(), 1204var services = new ServiceCollection();
PersistentContainerWarningTests.cs (3)
21var services = new ServiceCollection(); 45var services = new ServiceCollection(); 69var services = new ServiceCollection();
Publishing\PipelineActivityReporterTests.cs (1)
1283var services = new ServiceCollection();
ResourceCommandAnnotationTests.cs (2)
67ServiceProvider = new ServiceCollection().BuildServiceProvider() 147ServiceProvider = new ServiceCollection().BuildServiceProvider()
tests\Aspire.Hosting.Testing.Tests\DistributedApplicationHttpClientExtensionsForTests.cs (2)
31var services = new ServiceCollection(); 43var services = new ServiceCollection();
Utils\ManifestUtils.cs (3)
27var serviceCollection = new ServiceCollection(); 53ServiceProvider = new ServiceCollection().BuildServiceProvider() 72ServiceProvider = new ServiceCollection().BuildServiceProvider()
Aspire.Keycloak.Authentication.Tests (20)
KeycloakAuthenticationPublicApiTests.cs (20)
32var services = new ServiceCollection(); 50var services = new ServiceCollection(); 82var services = new ServiceCollection(); 101var services = new ServiceCollection(); 120var services = new ServiceCollection(); 153var services = new ServiceCollection(); 172var services = new ServiceCollection(); 210var services = new ServiceCollection(); 234var services = new ServiceCollection(); 258var services = new ServiceCollection(); 295var services = new ServiceCollection(); 313var services = new ServiceCollection(); 345var services = new ServiceCollection(); 364var services = new ServiceCollection(); 383var services = new ServiceCollection(); 416var services = new ServiceCollection(); 435var services = new ServiceCollection(); 473var services = new ServiceCollection(); 497var services = new ServiceCollection(); 521var services = new ServiceCollection();
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
196var services = new ServiceCollection()
Aspire.Templates.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
505var services = new ServiceCollection();
Microsoft.Arcade.Common (1)
MSBuildTaskBase.cs (1)
32ServiceCollection collection = new ServiceCollection();
Microsoft.AspNetCore.AsyncState.Tests (2)
AsyncContextHttpContextOfTTests.cs (1)
20var serviceCollection = new ServiceCollection()
AsyncStateHttpContextExtensionsTests.cs (1)
24var services = new ServiceCollection();
Microsoft.AspNetCore.DataProtection.Extensions (1)
DataProtectionProvider.cs (1)
127var serviceCollection = new ServiceCollection();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (18)
Buffering\PerIncomingRequestLoggingBuilderExtensionsTests.cs (3)
29var serviceCollection = new ServiceCollection(); 63var serviceCollection = new ServiceCollection(); 80var serviceCollection = new ServiceCollection();
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
29using var serviceProvider = new ServiceCollection()
Latency\RequestLatencyTelemetryExtensionsTests.cs (4)
23RequestLatencyTelemetryServiceCollectionExtensions.AddRequestLatencyTelemetry(new ServiceCollection(), configure: null!)); 25RequestLatencyTelemetryServiceCollectionExtensions.AddRequestLatencyTelemetry(new ServiceCollection(), section: null!)); 33using var serviceProvider = new ServiceCollection() 58using var serviceProvider = new ServiceCollection()
Logging\HttpLoggingServiceExtensionsTests.cs (2)
34var services = new ServiceCollection(); 58var services = new ServiceCollection();
Logging\HttpUtilityExtensionsTests.cs (1)
27var sp = new ServiceCollection().AddHttpRouteUtilities().BuildServiceProvider();
Logging\LoggingOptionsValidationTests.cs (3)
22using var services = new ServiceCollection() 38using var services = new ServiceCollection() 54using var services = new ServiceCollection()
Logging\RequestHeadersEnricherExtensionsTests.cs (4)
25new ServiceCollection().AddRequestHeadersLogEnricher(null!)); 31using var sp = new ServiceCollection() 42using var serviceProvider = new ServiceCollection() 55using var serviceProvider = new ServiceCollection()
Microsoft.AspNetCore.HeaderParsing.Tests (10)
HeaderParsingExtensionsTests.cs (8)
21using var services = new ServiceCollection() 33using var services = new ServiceCollection() 43using var services = new ServiceCollection() 53using var services = new ServiceCollection() 87var context = CreateContext(new ServiceCollection().AddSingleton(headerRegistry.Object)); 94var context = CreateContext(new ServiceCollection().AddHeaderParsing()); 108var context = CreateContext(new ServiceCollection().AddHeaderParsing()); 123services ??= new ServiceCollection();
HeaderParsingFeatureTests.cs (1)
34_services = new ServiceCollection();
HeaderRegistryTests.cs (1)
21_services = new ServiceCollection();
Microsoft.AspNetCore.Hosting (2)
Internal\ServiceCollectionExtensions.cs (1)
12IServiceCollection clone = new ServiceCollection();
WebHostBuilder.cs (1)
267var services = new ServiceCollection();
Microsoft.AspNetCore.Testing.Tests (2)
FakeStartupTests.cs (2)
20sut.Configure(new ApplicationBuilder(new ServiceCollection().BuildServiceProvider())); 22sut.ConfigureServices(new ServiceCollection());
Microsoft.DotNet.Internal.DependencyInjection.Testing (1)
DependencyInjectionValidation.cs (1)
44var services = new ServiceCollection();
Microsoft.Extensions.AI.Abstractions.Tests (3)
Functions\AIFunctionArgumentsTests.cs (3)
50ServiceCollection sc = new(); 68ServiceCollection sc = new(); 106ServiceCollection sc = new();
Microsoft.Extensions.AI.Tests (45)
ChatCompletion\ChatClientBuilderTest.cs (1)
15var expectedServiceProvider = new ServiceCollection().BuildServiceProvider();
ChatCompletion\DependencyInjectionPatterns.cs (7)
12private IServiceCollection ServiceCollection { get; } = new ServiceCollection(); 119ServiceCollection sc = new(); 141ServiceCollection sc = new(); 164ServiceCollection sc = new(); 187ServiceCollection sc = new(); 209ServiceCollection sc = new(); 233ServiceCollection sc = new();
ChatCompletion\DistributedCachingChatClientTest.cs (1)
737var services = new ServiceCollection()
ChatCompletion\FunctionInvokingChatClientTests.cs (6)
1064ServiceCollection c = new(); 1455ServiceCollection c = new(); 3236ServiceCollection c = new(); 3265ServiceCollection c = new(); 3297ServiceCollection c = new(); 3330ServiceCollection c = new();
ChatCompletion\ImageGeneratingChatClientTests.cs (1)
154var services = new ServiceCollection();
ChatCompletion\LoggingChatClientTests.cs (2)
35ServiceCollection c = new(); 51ServiceCollection c = new();
ChatCompletion\ReducingChatClientTests.cs (2)
101var services = new ServiceCollection(); 127var services = new ServiceCollection().BuildServiceProvider();
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (1)
376var services = new ServiceCollection()
Embeddings\EmbeddingGeneratorBuilderTests.cs (1)
15var expectedServiceProvider = new ServiceCollection().BuildServiceProvider();
Embeddings\LoggingEmbeddingGeneratorTests.cs (2)
34ServiceCollection c = new(); 50ServiceCollection c = new();
Functions\AIFunctionFactoryTest.cs (8)
403ServiceCollection sc = new(); 449ServiceCollection sc = new(); 479ServiceCollection sc = new(); 593ServiceCollection sc = new(); 616ServiceCollection sc = new(); 639ServiceCollection sc = new(); 711IServiceProvider sp1 = new ServiceCollection().AddSingleton(new MyService(42)).BuildServiceProvider(); 712IServiceProvider sp2 = new ServiceCollection().AddSingleton(new MyService(43)).BuildServiceProvider();
Image\ImageGeneratorBuilderTests.cs (1)
15var expectedServiceProvider = new ServiceCollection().BuildServiceProvider();
Image\ImageGeneratorDependencyInjectionPatterns.cs (4)
12private IServiceCollection ServiceCollection { get; } = new ServiceCollection(); 119ServiceCollection sc = new(); 141ServiceCollection sc = new(); 160ServiceCollection sc = new();
Image\LoggingImageGeneratorTests.cs (2)
35ServiceCollection c = new(); 51ServiceCollection c = new();
SpeechToText\LoggingSpeechToTextClientTests.cs (2)
37ServiceCollection c = new(); 53ServiceCollection c = new();
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (4)
12private IServiceCollection ServiceCollection { get; } = new ServiceCollection(); 119ServiceCollection sc = new(); 141ServiceCollection sc = new(); 160ServiceCollection sc = new();
Microsoft.Extensions.AmbientMetadata.Application.Tests (4)
ApplicationMetadataExtensionsTests.cs (4)
35var serviceCollection = new ServiceCollection(); 51var serviceCollection = new ServiceCollection(); 131using var provider = new ServiceCollection() 151using var provider = new ServiceCollection()
Microsoft.Extensions.AmbientMetadata.Build.Tests (3)
BuildMetadataServiceCollectionExtensionsTests.cs (3)
19var serviceCollection = new ServiceCollection(); 61using var provider = new ServiceCollection() 84using var provider = new ServiceCollection()
Microsoft.Extensions.AsyncState.Tests (2)
AsyncContextServiceCollectionExtensionsTests.cs (1)
23var services = new ServiceCollection();
AsyncStateTests.cs (1)
257var services = new ServiceCollection().AddAsyncState().BuildServiceProvider();
Microsoft.Extensions.Caching.Hybrid.Tests (47)
BufferReleaseTests.cs (2)
26var services = new ServiceCollection(); 259using ServiceProvider services = new ServiceCollection().BuildServiceProvider();
DistributedCacheTests.cs (1)
45var services = new ServiceCollection();
ExpirationTests.cs (1)
30ServiceCollection services = new();
FunctionalTests.cs (1)
14var services = new ServiceCollection();
L2Tests.cs (1)
37var services = new ServiceCollection();
LocalInvalidationTests.cs (1)
17var services = new ServiceCollection();
PayloadTests.cs (1)
20var services = new ServiceCollection();
RedisTests.cs (1)
45var services = new ServiceCollection();
SampleUsage.cs (4)
16var services = new ServiceCollection(); 36var services = new ServiceCollection(); 56var services = new ServiceCollection(); 76var services = new ServiceCollection();
SerializerTests.cs (1)
238var services = new ServiceCollection();
ServiceConstructionTests.cs (25)
29var services = new ServiceCollection(); 38var services = new ServiceCollection(); 58var services = new ServiceCollection(); 74var services = new ServiceCollection(); 84var services = new ServiceCollection(); 95var services = new ServiceCollection(); 109var services = new ServiceCollection(); 124var services = new ServiceCollection(); 146var services = new ServiceCollection(); 161var services = new ServiceCollection(); 183var services = new ServiceCollection(); 207var services = new ServiceCollection(); 243var services = new ServiceCollection(); 320var services = new ServiceCollection(); 360var services = new ServiceCollection(); 398var services = new ServiceCollection(); 428var services = new ServiceCollection(); 441var services = new ServiceCollection(); 454var services = new ServiceCollection(); 468var services = new ServiceCollection(); 480var services = new ServiceCollection(); 494var services = new ServiceCollection(); 514var services = new ServiceCollection(); 528var services = new ServiceCollection(); 589var services = new ServiceCollection();
SizeTests.cs (4)
32var services = new ServiceCollection(); 101var services = new ServiceCollection(); 154var services = new ServiceCollection(); 216var services = new ServiceCollection();
StampedeTests.cs (2)
17var services = new ServiceCollection(); 65var services = new ServiceCollection();
UnreliableL2Tests.cs (2)
128var services = new ServiceCollection(); 136services = new ServiceCollection();
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Classification\DataClassificationTypeConverterTests.cs (1)
45IServiceCollection serviceCollection = new ServiceCollection()
Microsoft.Extensions.Compliance.Redaction.Tests (9)
HmacRedactorExtensionsTests.cs (2)
16using var serviceProvider = new ServiceCollection() 29using var serviceProvider = new ServiceCollection()
HmacRedactorTest.cs (2)
95var redactorProvider = new ServiceCollection() 123var redactorProvider = new ServiceCollection()
RedactionAcceptanceTests.cs (4)
20using var services = new ServiceCollection() 43using var services = new ServiceCollection() 57Assert.Throws<ArgumentNullException>(() => new ServiceCollection().AddRedaction(null!)); 63using var serviceProvider = new ServiceCollection()
RedactorProviderTests.cs (1)
78var redactorProvider = new ServiceCollection()
Microsoft.Extensions.Compliance.Testing.Tests (14)
RedactionFakesAcceptanceTests.cs (13)
20using var services = new ServiceCollection() 39using var services = new ServiceCollection() 59using var services = new ServiceCollection() 78using var services = new ServiceCollection() 98using var services = new ServiceCollection() 117using var services = new ServiceCollection() 137using var services = new ServiceCollection() 157using var services = new ServiceCollection() 177using var services = new ServiceCollection() 199using var services = new ServiceCollection() 234Assert.Throws<ArgumentNullException>(() => new ServiceCollection().AddRedaction(x => x.SetFakeRedactor((Action<FakeRedactorOptions>)null!, dc))); 239Assert.Throws<ArgumentNullException>(() => new ServiceCollection().AddFakeRedaction(null!)); 245using var sp = new ServiceCollection().AddFakeRedaction().BuildServiceProvider();
RedactionFakesEventCollectorTests.cs (1)
25using var sp = new ServiceCollection().BuildServiceProvider();
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (9)
ApplicationLifecycleHealthChecksExtensionsTests.cs (3)
19var serviceCollection = new ServiceCollection(); 29var serviceCollection = new ServiceCollection(); 39var serviceCollection = new ServiceCollection();
ManualHealthCheckExtensionsTests.cs (3)
17var serviceCollection = new ServiceCollection(); 26var serviceCollection = new ServiceCollection(); 35var serviceCollection = new ServiceCollection();
TelemetryHealthChecksPublisherExtensionsTests.cs (3)
17var serviceCollection = new ServiceCollection(); 34var serviceCollection = new ServiceCollection(); 54var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (9)
ResourceMonitoringBuilderTests.cs (2)
18using var provider = new ServiceCollection() 39using var provider = new ServiceCollection()
ResourceMonitoringExtensionsTests.cs (7)
25var services = new ServiceCollection(); 37using var provider = new ServiceCollection() 58using var provider = new ServiceCollection() 75using var provider = new ServiceCollection() 219var services = new ServiceCollection(); 233var services = new ServiceCollection(); 247var services = new ServiceCollection();
Microsoft.Extensions.Diagnostics.Testing.Tests (4)
Logging\FakeLoggerExtensionsTests.cs (4)
18using var serviceProvider = new ServiceCollection() 34using var serviceProvider = new ServiceCollection() 62using var serviceProvider = new ServiceCollection() 82using var serviceProvider = new ServiceCollection()
Microsoft.Extensions.Hosting (2)
HostApplicationBuilder.cs (1)
23private readonly ServiceCollection _serviceCollection = new();
HostBuilder.cs (1)
336var services = new ServiceCollection();
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (8)
HttpClientFactory.cs (8)
16var services = new ServiceCollection(); 40var services = new ServiceCollection(); 63var services = new ServiceCollection(); 90var services = new ServiceCollection(); 113var services = new ServiceCollection(); 136var services = new ServiceCollection(); 162=> new ServiceCollection() 172=> new ServiceCollection()
Microsoft.Extensions.Http.Diagnostics.Tests (40)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (4)
36using var sp = new ServiceCollection() 60using var sp = new ServiceCollection() 74using var sp = new ServiceCollection() 98using var sp = new ServiceCollection()
Logging\AcceptanceTests.cs (15)
30await using var sp = new ServiceCollection() 62await using var sp = new ServiceCollection() 96await using var sp = new ServiceCollection() 133await using var provider = new ServiceCollection() 210await using var provider = new ServiceCollection() 295await using var sp = new ServiceCollection() 341await using var sp = new ServiceCollection() 406await using var sp = new ServiceCollection() 447using var provider = new ServiceCollection() 481using var provider = new ServiceCollection() 516using var provider = new ServiceCollection() 581await using var provider = new ServiceCollection() 603await using var provider = new ServiceCollection() 631await using var provider = new ServiceCollection() 659await using var provider = new ServiceCollection()
Logging\HttpClientLoggerTest.cs (1)
1019var builder = new ServiceCollection()
Logging\HttpClientLoggingExtensionsTest.cs (14)
83var services = new ServiceCollection(); 106var services = new ServiceCollection(); 129var services = new ServiceCollection(); 160var services = new ServiceCollection(); 230using var provider = new ServiceCollection() 245using var provider = new ServiceCollection() 269var services = new ServiceCollection(); 315using var provider = new ServiceCollection() 337using var provider = new ServiceCollection() 360using var provider = new ServiceCollection() 380using var provider = new ServiceCollection() 398using var sp = new ServiceCollection() 411await using var sp = new ServiceCollection() 446var serviceCollection = new ServiceCollection();
Logging\HttpRequestReaderTest.cs (1)
891var services = new ServiceCollection();
Telemetry\HttpDependencyMetadataResolverTests.cs (1)
19_sp = new ServiceCollection()
TelemetryCommonExtensionsTests.cs (4)
40var sp = new ServiceCollection().AddFakeRedaction().AddHttpRouteProcessor().BuildServiceProvider(); 55var sp = new ServiceCollection().AddFakeRedaction().AddHttpHeadersRedactor().BuildServiceProvider(); 63var serviceCollection = new ServiceCollection(); 87var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Http.Resilience.PerformanceTests (3)
HttpClientFactory.cs (1)
36var services = new ServiceCollection();
RetryBenchmark.cs (1)
32var services = new ServiceCollection();
StandardResilienceBenchmark.cs (1)
32var services = new ServiceCollection();
Microsoft.Extensions.Http.Resilience.Tests (28)
Hedging\HedgingTests.cs (1)
47_services = new ServiceCollection().AddMetrics().AddLogging();
Hedging\StandardHedgingTests.cs (1)
308var services = new ServiceCollection();
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (13)
29var services = new ServiceCollection(); 47var services = new ServiceCollection(); 67var services = new ServiceCollection(); 90var services = new ServiceCollection(); 120var clientBuilder = new ServiceCollection() 170var services = new ServiceCollection(); 204var services = new ServiceCollection().AddLogging().AddMetrics().AddFakeRedaction(); 248var services = new ServiceCollection().AddLogging().AddMetrics(); 279var clientBuilder = new ServiceCollection().AddLogging().AddMetrics().AddRedaction() 293var services = new ServiceCollection(); 301var services = new ServiceCollection(); 326var services = new ServiceCollection(); 342var services = new ServiceCollection();
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (9)
31_builder = new ServiceCollection().AddHttpClient(BuilderName); 115var builder = new ServiceCollection().AddHttpClient("test"); 126var builder = new ServiceCollection().AddHttpClient("test"); 136var builder = new ServiceCollection().AddHttpClient("test"); 146var builder = new ServiceCollection().AddLogging().AddMetrics().AddHttpClient("test"); 156using var serviceProvider = new ServiceCollection() 182var builder = new ServiceCollection().AddLogging().AddMetrics().AddHttpClient("test"); 211var builder = new ServiceCollection().AddLogging().AddMetrics().AddHttpClient("test"); 264var builder = new ServiceCollection().AddLogging().AddMetrics().AddHttpClient("test").AddStandardResilienceHandler();
Routing\RoutingStrategyTest.cs (4)
26Builder = new RoutingStrategyBuilder(RoutingName, new ServiceCollection()); 81Builder = new RoutingStrategyBuilder(RoutingName, new ServiceCollection()); 100Builder = new RoutingStrategyBuilder(RoutingName, new ServiceCollection()); 136Builder = new RoutingStrategyBuilder(RoutingName, new ServiceCollection());
Microsoft.Extensions.Logging (1)
LoggerFactory.cs (1)
114var serviceCollection = new ServiceCollection();
Microsoft.Extensions.ML.Tests (7)
FileLoaderTests.cs (3)
29var services = new ServiceCollection() 42var services = new ServiceCollection() 61var services = new ServiceCollection()
PredictionEnginePoolTests.cs (1)
29var services = new ServiceCollection()
UriLoaderTests.cs (3)
29var services = new ServiceCollection() 42var services = new ServiceCollection() 61var services = new ServiceCollection()
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (15)
DependencyInjectionExtensionsTests.cs (15)
34() => new ServiceCollection().ConfigurePools(builder.Build().GetSection("My:Pools"))); 51var services = new ServiceCollection().ConfigurePools(builder.Build().GetSection("My:Pools")); 63var services = new ServiceCollection() 81Assert.Throws<ArgumentNullException>(() => new ServiceCollection().ConfigurePools(null!)); 87var services = new ServiceCollection().AddPooled<TestDependency>(); 98var services = new ServiceCollection() 115var services = new ServiceCollection().AddPooled<TestDependency>(options => options.Capacity = 64); 128var services = new ServiceCollection() 142var services = new ServiceCollection() 158var services = new ServiceCollection() 177var services = new ServiceCollection() 212var services = new ServiceCollection() 223var services = new ServiceCollection() 258var services = new ServiceCollection() 315var services = new ServiceCollection()
Microsoft.Extensions.Options.Contextual.Tests (5)
ContextualOptionsServiceCollectionExtensionsTests.cs (5)
22using var provider = new ServiceCollection().AddContextualOptions().BuildServiceProvider(); 35using var provider = new ServiceCollection().Configure(loadOptions).BuildServiceProvider(); 45using var provider = new ServiceCollection().Configure(configureOptions).BuildServiceProvider(); 57using var provider = new ServiceCollection().ConfigureAll(loadOptions).BuildServiceProvider(); 67using var provider = new ServiceCollection().ConfigureAll(configureOptions).BuildServiceProvider();
Microsoft.Extensions.Resilience.PerformanceTests (1)
ResilienceEnrichmentBenchmark.cs (1)
40var services = new ServiceCollection();
Microsoft.Extensions.Resilience.Tests (2)
Resilience\ResilienceServiceCollectionExtensionsTests.cs (2)
27_services = new ServiceCollection().AddResilienceEnricher(); 46var services = new ServiceCollection().AddResilienceEnricher();
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (12)
DnsServiceEndpointResolverTests.cs (1)
18var services = new ServiceCollection()
DnsServicePublicApiTests.cs (2)
38IServiceCollection services = new ServiceCollection(); 84IServiceCollection services = new ServiceCollection();
DnsSrvServiceEndpointResolverTests.cs (2)
52var services = new ServiceCollection() 112var serviceCollection = new ServiceCollection()
Resolver\LoopbackDnsTestBase.cs (1)
42ServiceCollection services = new();
ServiceDiscoveryDnsServiceCollectionExtensionsTests.cs (6)
20var services = new ServiceCollection(); 32var services = new ServiceCollection(); 44var services = new ServiceCollection(); 57var services = new ServiceCollection(); 70var services = new ServiceCollection(); 83var services = new ServiceCollection();
Microsoft.Extensions.ServiceDiscovery.Tests (22)
ConfigurationServiceEndpointResolverTests.cs (7)
27var services = new ServiceCollection() 63var services = new ServiceCollection() 144var services = new ServiceCollection() 244var services = new ServiceCollection() 286var services = new ServiceCollection() 353var services = new ServiceCollection() 398var services = new ServiceCollection()
ExtensionsServicePublicApiTests.cs (3)
56var services = new ServiceCollection(); 91var services = new ServiceCollection(); 126var services = new ServiceCollection();
PassThroughServiceEndpointResolverTests.cs (4)
23var services = new ServiceCollection() 54var services = new ServiceCollection() 87var services = new ServiceCollection() 121var services = new ServiceCollection()
ServiceEndpointResolverTests.cs (8)
25var services = new ServiceCollection() 36var services = new ServiceCollection() 49var services = new ServiceCollection() 59var serviceCollection = new ServiceCollection(); 104var services = new ServiceCollection() 156var services = new ServiceCollection() 192var services = new ServiceCollection() 237var services = new ServiceCollection()
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (7)
YarpServiceDiscoveryTests.cs (7)
33await using var services = new ServiceCollection() 63await using var services = new ServiceCollection() 93await using var services = new ServiceCollection() 127await using var services = new ServiceCollection() 205await using var services = new ServiceCollection() 237await using var services = new ServiceCollection() 286await using var services = new ServiceCollection()
Microsoft.Extensions.Telemetry.Abstractions.Tests (13)
Enrichment\EnricherExtensionsTests.cs (4)
16Assert.Throws<ArgumentNullException>(() => new ServiceCollection().AddLogEnricher(null!)); 30new ServiceCollection().AddLogEnricher(null!)); 36var services = new ServiceCollection(); 55var services = new ServiceCollection();
Latency\LatencyRegistryExtensionsTests.cs (7)
17() => LatencyRegistryServiceCollectionExtensions.RegisterCheckpointNames(new ServiceCollection(), null!)); 23() => LatencyRegistryServiceCollectionExtensions.RegisterMeasureNames(new ServiceCollection(), null!)); 27() => LatencyRegistryServiceCollectionExtensions.RegisterTagNames(new ServiceCollection(), null!)); 33Assert.Throws<ArgumentException>(() => LatencyRegistryServiceCollectionExtensions.RegisterCheckpointNames(new ServiceCollection(), "")); 34Assert.Throws<ArgumentException>(() => LatencyRegistryServiceCollectionExtensions.RegisterMeasureNames(new ServiceCollection(), "")); 35Assert.Throws<ArgumentException>(() => LatencyRegistryServiceCollectionExtensions.RegisterTagNames(new ServiceCollection(), "")); 41var services = RegisterNames(new ServiceCollection());
Latency\NoopLatencyContextTests.cs (2)
22using var serviceProvider = new ServiceCollection() 34using var serviceProvider = new ServiceCollection()
Microsoft.Extensions.Telemetry.PerformanceTests (1)
ExtendedLoggerBench.cs (1)
69var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Telemetry.Tests (35)
Buffering\GlobalBufferLoggerBuilderExtensionsTests.cs (2)
20var serviceCollection = new ServiceCollection(); 54var serviceCollection = new ServiceCollection();
Enrichment\ApplicationEnricherExtensionsTests.cs (1)
30new ServiceCollection().AddApplicationLogEnricher((IConfigurationSection)null!));
Enrichment\ProcessEnricherExtensionsTests.cs (2)
30new ServiceCollection().AddProcessLogEnricher((IConfigurationSection)null!)); 33new ServiceCollection().AddProcessLogEnricher((Action<ProcessLogEnricherOptions>)null!));
Enrichment\ServiceEnricherExtensionsTests.cs (1)
31new ServiceCollection().AddServiceLogEnricher((IConfigurationSection)null!));
Http\HttpParserTests.cs (1)
644var sp = new ServiceCollection().AddHttpRouteProcessor().AddFakeRedaction().BuildServiceProvider();
Http\TelemetryCommonExtensionsTests.cs (1)
38var sp = new ServiceCollection().AddFakeRedaction().AddHttpRouteProcessor().BuildServiceProvider();
Latency\Internal\LatencyContextTests.cs (8)
77using var scope = new ServiceCollection() 103using var scope = new ServiceCollection() 129using var scope = new ServiceCollection() 156using var scope = new ServiceCollection() 187using var scope = new ServiceCollection() 214using var scope = new ServiceCollection() 239using var scope = new ServiceCollection() 264using var scope = new ServiceCollection()
Latency\LatencyConsoleExtensionsTests.cs (4)
19var s = new ServiceCollection(); 28using var serviceProvider = new ServiceCollection() 41using var serviceProvider = new ServiceCollection() 59using var provider = new ServiceCollection()
Latency\LatencyContextExtensionTests.cs (4)
27using var serviceProvider = new ServiceCollection() 43using var serviceProvider = new ServiceCollection() 70using var serviceProvider = new ServiceCollection() 95using var provider = new ServiceCollection()
Logging\Utils.cs (1)
13var serviceCollection = new ServiceCollection();
Sampling\SamplingLoggerBuilderExtensionsTests.cs (10)
23var serviceCollection = new ServiceCollection(); 39var serviceCollection = new ServiceCollection(); 64var serviceCollection = new ServiceCollection(); 117var serviceCollection = new ServiceCollection(); 159var serviceCollection = new ServiceCollection(); 176var serviceCollection = new ServiceCollection(); 199var serviceCollection = new ServiceCollection(); 218var serviceCollection = new ServiceCollection(); 236var serviceCollection = new ServiceCollection(); 251var serviceCollection = new ServiceCollection();
Microsoft.Gen.Logging.Generated.Tests (1)
Utils.cs (1)
71var serviceCollection = new ServiceCollection();
Microsoft.Maui (1)
Hosting\MauiAppBuilder.cs (1)
17 private readonly ServiceCollection _services = new();
Microsoft.ML.AutoML (1)
AutoMLExperiment\AutoMLExperiment.cs (1)
55_serviceCollection = new ServiceCollection();
Shared.Tests (3)
Debugger\DebuggerTest.cs (3)
23using var provider = new ServiceCollection() 36using var provider = new ServiceCollection() 49using var provider = new ServiceCollection()
217 references to ServiceCollection
Aspire.Cli.Tests (1)
Utils\CliTestHelper.cs (1)
49var services = new ServiceCollection();
Aspire.EndToEnd.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
505var services = new ServiceCollection();
Aspire.Hosting.Testing.Tests (2)
DistributedApplicationHttpClientExtensionsForTests.cs (2)
31var services = new ServiceCollection(); 43var services = new ServiceCollection();
Aspire.Hosting.Tests (10)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (1)
18var services = new ServiceCollection();
Orchestrator\ApplicationOrchestratorTests.cs (1)
465var services = new ServiceCollection();
Orchestrator\ParameterProcessorTests.cs (1)
1204var services = new ServiceCollection();
PersistentContainerWarningTests.cs (3)
21var services = new ServiceCollection(); 45var services = new ServiceCollection(); 69var services = new ServiceCollection();
Publishing\PipelineActivityReporterTests.cs (1)
1283var services = new ServiceCollection();
tests\Aspire.Hosting.Testing.Tests\DistributedApplicationHttpClientExtensionsForTests.cs (2)
31var services = new ServiceCollection(); 43var services = new ServiceCollection();
Utils\ManifestUtils.cs (1)
27var serviceCollection = new ServiceCollection();
Aspire.Keycloak.Authentication.Tests (20)
KeycloakAuthenticationPublicApiTests.cs (20)
32var services = new ServiceCollection(); 50var services = new ServiceCollection(); 82var services = new ServiceCollection(); 101var services = new ServiceCollection(); 120var services = new ServiceCollection(); 153var services = new ServiceCollection(); 172var services = new ServiceCollection(); 210var services = new ServiceCollection(); 234var services = new ServiceCollection(); 258var services = new ServiceCollection(); 295var services = new ServiceCollection(); 313var services = new ServiceCollection(); 345var services = new ServiceCollection(); 364var services = new ServiceCollection(); 383var services = new ServiceCollection(); 416var services = new ServiceCollection(); 435var services = new ServiceCollection(); 473var services = new ServiceCollection(); 497var services = new ServiceCollection(); 521var services = new ServiceCollection();
Aspire.Templates.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
505var services = new ServiceCollection();
Microsoft.Arcade.Common (1)
MSBuildTaskBase.cs (1)
32ServiceCollection collection = new ServiceCollection();
Microsoft.AspNetCore.AsyncState.Tests (1)
AsyncStateHttpContextExtensionsTests.cs (1)
24var services = new ServiceCollection();
Microsoft.AspNetCore.DataProtection.Extensions (1)
DataProtectionProvider.cs (1)
127var serviceCollection = new ServiceCollection();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Buffering\PerIncomingRequestLoggingBuilderExtensionsTests.cs (3)
29var serviceCollection = new ServiceCollection(); 63var serviceCollection = new ServiceCollection(); 80var serviceCollection = new ServiceCollection();
Logging\HttpLoggingServiceExtensionsTests.cs (2)
34var services = new ServiceCollection(); 58var services = new ServiceCollection();
Microsoft.AspNetCore.Hosting (2)
WebHostBuilder.cs (2)
267var services = new ServiceCollection(); 316private void ScanAssemblyAndRegisterStartup(ServiceCollection services, string startupAssemblyName)
Microsoft.DotNet.Internal.DependencyInjection.Testing (4)
DependencyInjectionValidation.cs (4)
34Action<ServiceCollection> register, 44var services = new ServiceCollection(); 92ServiceCollection services, 127ServiceCollection services,
Microsoft.Extensions.AI.Abstractions.Tests (3)
Functions\AIFunctionArgumentsTests.cs (3)
50ServiceCollection sc = new(); 68ServiceCollection sc = new(); 106ServiceCollection sc = new();
Microsoft.Extensions.AI.Tests (34)
ChatCompletion\DependencyInjectionPatterns.cs (6)
119ServiceCollection sc = new(); 141ServiceCollection sc = new(); 164ServiceCollection sc = new(); 187ServiceCollection sc = new(); 209ServiceCollection sc = new(); 233ServiceCollection sc = new();
ChatCompletion\FunctionInvokingChatClientTests.cs (6)
1064ServiceCollection c = new(); 1455ServiceCollection c = new(); 3236ServiceCollection c = new(); 3265ServiceCollection c = new(); 3297ServiceCollection c = new(); 3330ServiceCollection c = new();
ChatCompletion\ImageGeneratingChatClientTests.cs (1)
154var services = new ServiceCollection();
ChatCompletion\LoggingChatClientTests.cs (2)
35ServiceCollection c = new(); 51ServiceCollection c = new();
ChatCompletion\ReducingChatClientTests.cs (1)
101var services = new ServiceCollection();
Embeddings\LoggingEmbeddingGeneratorTests.cs (2)
34ServiceCollection c = new(); 50ServiceCollection c = new();
Functions\AIFunctionFactoryTest.cs (6)
403ServiceCollection sc = new(); 449ServiceCollection sc = new(); 479ServiceCollection sc = new(); 593ServiceCollection sc = new(); 616ServiceCollection sc = new(); 639ServiceCollection sc = new();
Image\ImageGeneratorDependencyInjectionPatterns.cs (3)
119ServiceCollection sc = new(); 141ServiceCollection sc = new(); 160ServiceCollection sc = new();
Image\LoggingImageGeneratorTests.cs (2)
35ServiceCollection c = new(); 51ServiceCollection c = new();
SpeechToText\LoggingSpeechToTextClientTests.cs (2)
37ServiceCollection c = new(); 53ServiceCollection c = new();
SpeechToText\SpeechToTextClientDependencyInjectionPatterns.cs (3)
119ServiceCollection sc = new(); 141ServiceCollection sc = new(); 160ServiceCollection sc = new();
Microsoft.Extensions.AmbientMetadata.Application.Tests (2)
ApplicationMetadataExtensionsTests.cs (2)
35var serviceCollection = new ServiceCollection(); 51var serviceCollection = new ServiceCollection();
Microsoft.Extensions.AmbientMetadata.Build.Tests (1)
BuildMetadataServiceCollectionExtensionsTests.cs (1)
19var serviceCollection = new ServiceCollection();
Microsoft.Extensions.AsyncState.Tests (1)
AsyncContextServiceCollectionExtensionsTests.cs (1)
23var services = new ServiceCollection();
Microsoft.Extensions.Caching.Hybrid.Tests (49)
BufferReleaseTests.cs (2)
24private static ServiceProvider GetDefaultCache(out DefaultHybridCache cache, Action<ServiceCollection>? config = null) 26var services = new ServiceCollection();
DistributedCacheTests.cs (1)
45var services = new ServiceCollection();
ExpirationTests.cs (1)
30ServiceCollection services = new();
FunctionalTests.cs (2)
12private static ServiceProvider GetDefaultCache(out DefaultHybridCache cache, Action<ServiceCollection>? config = null) 14var services = new ServiceCollection();
L2Tests.cs (1)
37var services = new ServiceCollection();
LocalInvalidationTests.cs (2)
15private static ServiceProvider GetDefaultCache(out DefaultHybridCache cache, Action<ServiceCollection>? config = null) 17var services = new ServiceCollection();
PayloadTests.cs (2)
18private static ServiceProvider GetDefaultCache(out DefaultHybridCache cache, Action<ServiceCollection>? config = null) 20var services = new ServiceCollection();
RedisTests.cs (1)
45var services = new ServiceCollection();
SampleUsage.cs (4)
16var services = new ServiceCollection(); 36var services = new ServiceCollection(); 56var services = new ServiceCollection(); 76var services = new ServiceCollection();
SerializerTests.cs (1)
238var services = new ServiceCollection();
ServiceConstructionTests.cs (25)
29var services = new ServiceCollection(); 38var services = new ServiceCollection(); 58var services = new ServiceCollection(); 74var services = new ServiceCollection(); 84var services = new ServiceCollection(); 95var services = new ServiceCollection(); 109var services = new ServiceCollection(); 124var services = new ServiceCollection(); 146var services = new ServiceCollection(); 161var services = new ServiceCollection(); 183var services = new ServiceCollection(); 207var services = new ServiceCollection(); 243var services = new ServiceCollection(); 320var services = new ServiceCollection(); 360var services = new ServiceCollection(); 398var services = new ServiceCollection(); 428var services = new ServiceCollection(); 441var services = new ServiceCollection(); 454var services = new ServiceCollection(); 468var services = new ServiceCollection(); 480var services = new ServiceCollection(); 494var services = new ServiceCollection(); 514var services = new ServiceCollection(); 528var services = new ServiceCollection(); 589var services = new ServiceCollection();
SizeTests.cs (4)
32var services = new ServiceCollection(); 101var services = new ServiceCollection(); 154var services = new ServiceCollection(); 216var services = new ServiceCollection();
StampedeTests.cs (2)
17var services = new ServiceCollection(); 65var services = new ServiceCollection();
UnreliableL2Tests.cs (1)
128var services = new ServiceCollection();
Microsoft.Extensions.DependencyInjection (1)
Properties\TypeForwards.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(Microsoft.Extensions.DependencyInjection.ServiceCollection))]
Microsoft.Extensions.DependencyInjection.Abstractions (2)
ServiceCollection.cs (2)
138private readonly ServiceCollection _services; 140public ServiceCollectionDebugView(ServiceCollection services)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (9)
ApplicationLifecycleHealthChecksExtensionsTests.cs (3)
19var serviceCollection = new ServiceCollection(); 29var serviceCollection = new ServiceCollection(); 39var serviceCollection = new ServiceCollection();
ManualHealthCheckExtensionsTests.cs (3)
17var serviceCollection = new ServiceCollection(); 26var serviceCollection = new ServiceCollection(); 35var serviceCollection = new ServiceCollection();
TelemetryHealthChecksPublisherExtensionsTests.cs (3)
17var serviceCollection = new ServiceCollection(); 34var serviceCollection = new ServiceCollection(); 54var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (4)
ResourceMonitoringExtensionsTests.cs (4)
25var services = new ServiceCollection(); 219var services = new ServiceCollection(); 233var services = new ServiceCollection(); 247var services = new ServiceCollection();
Microsoft.Extensions.Hosting (2)
HostApplicationBuilder.cs (1)
23private readonly ServiceCollection _serviceCollection = new();
HostBuilder.cs (1)
336var services = new ServiceCollection();
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (6)
HttpClientFactory.cs (6)
16var services = new ServiceCollection(); 40var services = new ServiceCollection(); 63var services = new ServiceCollection(); 90var services = new ServiceCollection(); 113var services = new ServiceCollection(); 136var services = new ServiceCollection();
Microsoft.Extensions.Http.Diagnostics.Tests (9)
Logging\HttpClientLoggingExtensionsTest.cs (6)
83var services = new ServiceCollection(); 106var services = new ServiceCollection(); 129var services = new ServiceCollection(); 160var services = new ServiceCollection(); 269var services = new ServiceCollection(); 446var serviceCollection = new ServiceCollection();
Logging\HttpRequestReaderTest.cs (1)
891var services = new ServiceCollection();
TelemetryCommonExtensionsTests.cs (2)
63var serviceCollection = new ServiceCollection(); 87var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Http.Resilience.PerformanceTests (3)
HttpClientFactory.cs (1)
36var services = new ServiceCollection();
RetryBenchmark.cs (1)
32var services = new ServiceCollection();
StandardResilienceBenchmark.cs (1)
32var services = new ServiceCollection();
Microsoft.Extensions.Http.Resilience.Tests (10)
Hedging\StandardHedgingTests.cs (1)
308var services = new ServiceCollection();
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (9)
29var services = new ServiceCollection(); 47var services = new ServiceCollection(); 67var services = new ServiceCollection(); 90var services = new ServiceCollection(); 170var services = new ServiceCollection(); 293var services = new ServiceCollection(); 301var services = new ServiceCollection(); 326var services = new ServiceCollection(); 342var services = new ServiceCollection();
Microsoft.Extensions.Logging (1)
LoggerFactory.cs (1)
114var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Resilience.PerformanceTests (1)
ResilienceEnrichmentBenchmark.cs (1)
40var services = new ServiceCollection();
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (7)
Resolver\LoopbackDnsTestBase.cs (1)
42ServiceCollection services = new();
ServiceDiscoveryDnsServiceCollectionExtensionsTests.cs (6)
20var services = new ServiceCollection(); 32var services = new ServiceCollection(); 44var services = new ServiceCollection(); 57var services = new ServiceCollection(); 70var services = new ServiceCollection(); 83var services = new ServiceCollection();
Microsoft.Extensions.ServiceDiscovery.Tests (4)
ExtensionsServicePublicApiTests.cs (3)
56var services = new ServiceCollection(); 91var services = new ServiceCollection(); 126var services = new ServiceCollection();
ServiceEndpointResolverTests.cs (1)
59var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Telemetry.Abstractions.Tests (2)
Enrichment\EnricherExtensionsTests.cs (2)
36var services = new ServiceCollection(); 55var services = new ServiceCollection();
Microsoft.Extensions.Telemetry.PerformanceTests (1)
ExtendedLoggerBench.cs (1)
69var serviceCollection = new ServiceCollection();
Microsoft.Extensions.Telemetry.Tests (14)
Buffering\GlobalBufferLoggerBuilderExtensionsTests.cs (2)
20var serviceCollection = new ServiceCollection(); 54var serviceCollection = new ServiceCollection();
Latency\LatencyConsoleExtensionsTests.cs (1)
19var s = new ServiceCollection();
Logging\Utils.cs (1)
13var serviceCollection = new ServiceCollection();
Sampling\SamplingLoggerBuilderExtensionsTests.cs (10)
23var serviceCollection = new ServiceCollection(); 39var serviceCollection = new ServiceCollection(); 64var serviceCollection = new ServiceCollection(); 117var serviceCollection = new ServiceCollection(); 159var serviceCollection = new ServiceCollection(); 176var serviceCollection = new ServiceCollection(); 199var serviceCollection = new ServiceCollection(); 218var serviceCollection = new ServiceCollection(); 236var serviceCollection = new ServiceCollection(); 251var serviceCollection = new ServiceCollection();
Microsoft.Gen.Logging.Generated.Tests (1)
Utils.cs (1)
71var serviceCollection = new ServiceCollection();
Microsoft.Maui (1)
Hosting\MauiAppBuilder.cs (1)
17 private readonly ServiceCollection _services = new();