84 references to FakeService
Microsoft.Extensions.DependencyInjection.AutoActivation.Tests (84)
AcceptanceTest.cs (22)
26.AddActivatedSingleton<IFakeService, FakeService>()) 47.AddSingleton<IFakeService, FakeService>()) 68.AddActivatedSingleton(typeof(IFakeService), typeof(FakeService)) 90.AddSingleton<IFakeService, FakeService>() 111.AddActivatedSingleton(typeof(IFakeService), typeof(FakeService)) 136.AddActivatedSingleton<IFakeService, FakeService>() 159.AddSingleton<IFakeService, FakeService>() 178.AddActivatedSingleton<FakeService>() 197.AddActivatedSingleton(typeof(FakeService)) 214.AddActivatedSingleton<IFakeService, FakeService>()) 233.AddSingleton<FakeService>() 235services.TryAddActivatedSingleton(typeof(FakeService)); 257.AddSingleton<FakeService>() 259services.TryAddActivatedSingleton<FakeService>(); 281services.TryAddActivatedSingleton(typeof(IFakeService), typeof(FakeService)); 303services.TryAddActivatedSingleton<IFakeService, FakeService>(); 322.AddSingleton<IFakeService, FakeService>() 357.AddSingleton<IFakeService, FakeService>().ActivateSingleton(typeof(IFakeService)) 376.AddSingleton<IFakeService, FakeService>().ActivateSingleton<IFakeService>() 395.AddSingleton<IFakeService, FakeService>() 416.AddSingleton(typeof(IFakeOpenGenericService<PocoClass>), typeof(FakeService)) 438.AddSingleton(typeof(IFakeOpenGenericService<PocoClass>), typeof(FakeService))
AcceptanceTest.Keyed.cs (20)
27.AddActivatedKeyedSingleton<IFakeService, FakeService>(serviceKey)) 49.AddActivatedKeyedSingleton(typeof(IFakeService), serviceKey, typeof(FakeService)) 72.AddSingleton<IFakeService, FakeService>() 94.AddActivatedKeyedSingleton(typeof(IFakeService), serviceKey, typeof(FakeService)) 120.AddActivatedKeyedSingleton<IFakeService, FakeService>(serviceKey) 144.AddSingleton<IFakeService, FakeService>() 164.AddActivatedKeyedSingleton<FakeService>(serviceKey) 184.AddActivatedKeyedSingleton(typeof(FakeService), serviceKey) 202.AddActivatedKeyedSingleton<IFakeService, FakeService>(serviceKey)) 222.AddKeyedSingleton<FakeService>(serviceKey) 224services.TryAddActivatedKeyedSingleton(typeof(FakeService), serviceKey); 247.AddKeyedSingleton<FakeService>(serviceKey) 249services.TryAddActivatedKeyedSingleton<FakeService>(serviceKey); 272services.TryAddActivatedKeyedSingleton(typeof(IFakeService), serviceKey, typeof(FakeService)); 295services.TryAddActivatedKeyedSingleton<IFakeService, FakeService>(serviceKey); 315.AddKeyedSingleton<IFakeService, FakeService>(serviceKey) 352.AddKeyedSingleton<IFakeService, FakeService>(serviceKey).ActivateKeyedSingleton<IFakeService>(serviceKey) 372.AddKeyedSingleton<IFakeService, FakeService>(serviceKey) 394.AddKeyedSingleton(typeof(IFakeOpenGenericService<PocoClass>), serviceKey, typeof(FakeService)) 417.AddKeyedSingleton(typeof(IFakeOpenGenericService<PocoClass>), serviceKey, typeof(FakeService))
AutoActivationExtensionsKeyedTests.cs (21)
19Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton<IFakeService, FakeService>(null!, null, (_, _) => null!)); 20Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton<IFakeService, FakeService>(serviceCollection, null, null!)); 22Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton<FakeService>(null!, null, (_, _) => null!)); 23Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton<FakeService>(serviceCollection, null, null!)); 25Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton<FakeService>(null!, null)); 27Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(null!, typeof(FakeService), null)); 30Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton<IFakeService, FakeService>(null!, null)); 32Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(null!, typeof(FakeService), null, (_, _) => null!)); 34Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(serviceCollection, typeof(FakeService), null, implementationFactory: null!)); 36Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(null!, typeof(IFakeService), null, typeof(FakeService))); 37Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedKeyedSingleton(serviceCollection, null!, null, typeof(FakeService))); 45Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(null!, typeof(FakeService), null)); 48Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(null!, typeof(IFakeService), null, typeof(FakeService))); 49Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(serviceCollection, null!, null, typeof(FakeService))); 52Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(null!, typeof(FakeService), null, (_, _) => null!)); 54Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton(serviceCollection, typeof(FakeService), null, implementationFactory: null!)); 56Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton<FakeService>(null!, null)); 58Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton<IFakeService, FakeService>(null!, null)); 60Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton<FakeService>(null!, null, (_, _) => null!)); 61Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedKeyedSingleton<FakeService>(serviceCollection, null, null!)); 70serviceCollection.AddActivatedKeyedSingleton<IFakeService, FakeService>(null);
AutoActivationExtensionsTests.cs (21)
25Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton<IFakeService, FakeService>(null!, _ => null!)); 26Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton<IFakeService, FakeService>(serviceCollection, null!)); 28Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton<FakeService>(null!, _ => null!)); 29Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton<FakeService>(serviceCollection, null!)); 31Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton<FakeService>(null!)); 33Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton(null!, typeof(FakeService))); 36Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton<IFakeService, FakeService>(null!)); 38Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton(null!, typeof(FakeService), _ => null!)); 40Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton(serviceCollection, typeof(FakeService), implementationFactory: null!)); 42Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton(null!, typeof(IFakeService), typeof(FakeService))); 43Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.AddActivatedSingleton(serviceCollection, null!, typeof(FakeService))); 51Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton(null!, typeof(FakeService))); 54Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton(null!, typeof(IFakeService), typeof(FakeService))); 55Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton(serviceCollection, null!, typeof(FakeService))); 58Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton(null!, typeof(FakeService), _ => null!)); 60Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton(serviceCollection, typeof(FakeService), implementationFactory: null!)); 62Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton<FakeService>(null!)); 64Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton<IFakeService, FakeService>(null!)); 66Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton<FakeService>(null!, _ => null!)); 67Assert.Throws<ArgumentNullException>(() => AutoActivationExtensions.TryAddActivatedSingleton<FakeService>(serviceCollection, null!)); 76serviceCollection.AddActivatedSingleton<IFakeService, FakeService>();