4 references to TryAddActivatedKeyedSingleton
Microsoft.Extensions.DependencyInjection.AutoActivation.Tests (4)
AcceptanceTest.Keyed.cs (1)
225services.TryAddActivatedKeyedSingleton(typeof(AnotherFakeService), serviceKey, (sp, _) => new AnotherFakeService(sp.GetService<IAnotherFakeServiceCounter>()!));
AutoActivationExtensionsKeyedTests.cs (3)
52Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(null!, typeof(FakeService), null, (_, _) => null!)); 53Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(serviceCollection, null!, null, (_, _) => null!)); 54Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(serviceCollection, typeof(FakeService), null, implementationFactory: null!));