22 references to TestDependency
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (22)
DependencyInjectionExtensionsTests.cs (21)
30new KeyValuePair<string, string?>($"My:Pools:{typeof(TestDependency).FullName!}", "4096"), 48new KeyValuePair<string, string?>($"My:Pools:{typeof(TestDependency).FullName!}", "4096"), 57Assert.Equal(4096, sut.Get(typeof(TestDependency).FullName!).Capacity); 65.Configure<DependencyInjectionPoolOptions>(typeof(TestDependency).FullName, options => options.Capacity = 4096); 75Assert.Equal(4096, options.Get(typeof(TestDependency).FullName!).Capacity); 87var services = new ServiceCollection().AddPooled<TestDependency>(); 89var pool = services.BuildServiceProvider(validateScopes: true).GetService<ObjectPool<TestDependency>>(); 99.AddSingleton<TestDependency>() 115var services = new ServiceCollection().AddPooled<TestDependency>(options => options.Capacity = 64); 117var pool = services.BuildServiceProvider().GetService<ObjectPool<TestDependency>>(); 122Assert.Equal(64, optionsMonitor.Get(typeof(TestDependency).FullName).Capacity); 129.AddSingleton<TestDependency>() 136Assert.Equal(TestDependency.DefaultMessage, pool!.Get().ReadMessage()); 143.AddSingleton<TestDependency>() 151Assert.Equal(TestDependency.DefaultMessage, pool!.Get().ReadMessage()); 159.AddSingleton<TestDependency>() 178.AddSingleton<TestDependency>() 213.AddScoped<TestDependency>() 224.AddSingleton<TestDependency>() 259.AddSingleton<TestDependency>() 316.AddSingleton<TestDependency>()
TestResources\TestClass.cs (1)
14public TestClass(TestDependency _)