5 references to TryAddActivatedKeyedSingleton
Microsoft.Extensions.DependencyInjection.AutoActivation.Tests (5)
AcceptanceTest.Keyed.cs (2)
272services.TryAddActivatedKeyedSingleton(typeof(IFakeService), serviceKey, typeof(FakeService)); 273services.TryAddActivatedKeyedSingleton(typeof(IFakeService), serviceKey, typeof(AnotherFakeService));
AutoActivationExtensionsKeyedTests.cs (3)
48Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(null!, typeof(IFakeService), null, typeof(FakeService))); 49Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(serviceCollection, null!, null, typeof(FakeService))); 50Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(serviceCollection, typeof(IFakeService), null, implementationType: null!));