4 instantiations of Service
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (4)
1819Assert.Throws<InvalidOperationException>(() => builder.Services.AddSingleton<IService>(new Service())); 1820Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddSingleton(new Service())); 1823Assert.Throws<InvalidOperationException>(() => builder.Services.Remove(ServiceDescriptor.Singleton(new Service()))); 1824Assert.Throws<InvalidOperationException>(() => builder.Services[0] = ServiceDescriptor.Singleton(new Service()));
8 references to Service
Microsoft.AspNetCore.Tests (8)
WebApplicationTests.cs (8)
1499services.AddSingleton<IService, Service>(); 1514Assert.IsType<Service>(service0); 1515Assert.IsType<Service>(service1); 1791builder.Services.AddScoped<Service>(); 1805builder.Services.AddScoped<Service>(); 1821Assert.Throws<InvalidOperationException>(() => builder.Services.AddScoped<IService, Service>()); 1822Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddScoped<IService, Service>()); 2953public Service2(Service service)