4 references to AddActivatedKeyedSingleton
Microsoft.Extensions.DependencyInjection.AutoActivation.Tests (4)
AcceptanceTest.Keyed.cs (1)
185.AddActivatedKeyedSingleton(typeof(AnotherFakeService), serviceKey, (sp, _) => new AnotherFakeService(sp.GetService<IAnotherFakeServiceCounter>()!)))
AutoActivationExtensionsKeyedTests.cs (3)
32Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(null!, typeof(FakeService), null, (_, _) => null!)); 33Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(serviceCollection, null!, null, (_, _) => null!)); 34Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(serviceCollection, typeof(FakeService), null, implementationFactory: null!));