4 instantiations of Service
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (4)
1817Assert.Throws<InvalidOperationException>(() => builder.Services.AddSingleton<IService>(new Service())); 1818Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddSingleton(new Service())); 1821Assert.Throws<InvalidOperationException>(() => builder.Services.Remove(ServiceDescriptor.Singleton(new Service()))); 1822Assert.Throws<InvalidOperationException>(() => builder.Services[0] = ServiceDescriptor.Singleton(new Service()));
8 references to Service
Microsoft.AspNetCore.Tests (8)
WebApplicationTests.cs (8)
1497services.AddSingleton<IService, Service>(); 1512Assert.IsType<Service>(service0); 1513Assert.IsType<Service>(service1); 1789builder.Services.AddScoped<Service>(); 1803builder.Services.AddScoped<Service>(); 1819Assert.Throws<InvalidOperationException>(() => builder.Services.AddScoped<IService, Service>()); 1820Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddScoped<IService, Service>()); 2951public Service2(Service service)