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)
466builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 492builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 514builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 535builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 563builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 594builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 623builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 663builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", new FakeContainerRuntime(shouldFail: true)); 698builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 758builder.Services.AddKeyedSingleton<IContainerRuntime>("docker", fakeContainerRuntime); 867builder.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)
593sc.AddKeyedSingleton("key", service); 639sc.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);