19 references to AddKeyedSingleton
Aspire.Azure.Messaging.EventHubs.Tests (1)
AspireEventHubsExtensionsTests.cs (1)
65services.AddKeyedSingleton("blobs", blobClient);
Aspire.Hosting.Azure.Tests (1)
ContainerRegistryTests.cs (1)
89builder.Services.AddKeyedSingleton<IDistributedApplicationPublisher>("test-publisher", publisherValidator);
Aspire.Hosting.Tests (11)
Publishing\ResourceContainerImageBuilderTests.cs (11)
432builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 458builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 480builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 501builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 529builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 560builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 589builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 629builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", new FakeContainerRuntime(shouldFail: true)); 664builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 724builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 833builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime);
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1778serviceCollection.AddKeyedSingleton("foo", new InferredServiceClass());
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorPageActivatorTest.cs (1)
252.AddKeyedSingleton(KeyedServiceKey, myService)
Microsoft.Extensions.AI.Tests (2)
Functions\AIFunctionFactoryTest.cs (2)
514sc.AddKeyedSingleton("key", service); 560sc.AddKeyedSingleton("key", service);
Microsoft.Extensions.Caching.Hybrid.Tests (2)
SerializerTests.cs (2)
246services.AddKeyedSingleton<JsonSerializerOptions>(typeof(IHybridCacheSerializer<>), globalOptions); 252services.AddKeyedSingleton<JsonSerializerOptions>(typeof(IHybridCacheSerializer<T>), perTypeOptions);