22 references to TestClass
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (22)
DependencyInjectionExtensionsTests.cs (22)
19Assert.Throws<ArgumentNullException>(() => ObjectPoolServiceCollectionExtensions.AddPooled<TestClass>(null!)); 20Assert.Throws<ArgumentNullException>(() => ObjectPoolServiceCollectionExtensions.AddPooled<ITestClass, TestClass>(null!)); 29new KeyValuePair<string, string?>($"My:Pools:{typeof(TestClass).FullName!}", "twenty!"), 47new KeyValuePair<string, string?>($"My:Pools:{typeof(TestClass).FullName!}", "2048"), 56Assert.Equal(2048, sut.Get(typeof(TestClass).FullName!).Capacity); 64.Configure<DependencyInjectionPoolOptions>(typeof(TestClass).FullName, options => options.Capacity = 2048) 74Assert.Equal(2048, options.Get(typeof(TestClass).FullName!).Capacity); 100.AddPooled<ITestClass, TestClass>() 130.AddPooled<ITestClass, TestClass>(); 144.AddPooled<ITestClass, TestClass>(options => options.Capacity = 64); 160.AddPooled<ITestClass, TestClass>(); 179.AddPooled<ITestClass, TestClass>(options => options.Capacity = capacity); 214.AddPooled<ITestClass, TestClass>(); 225.AddPooled<TestClass>() 226.AddScoped<Pooled<TestClass>>() 227.AddScoped<ITestClass>(provider => provider.GetRequiredService<Pooled<TestClass>>().Object) 260.AddPooled<TestClass>() 261.AddTransient<Pooled<TestClass>>() 262.AddTransient<ITestClass>(provider => provider.GetRequiredService<Pooled<TestClass>>().Object) 317.AddPooled<TestClass>() 318.AddScoped<Pooled<TestClass>>() 319.AddScoped<ITestClass>(provider => provider.GetRequiredService<Pooled<TestClass>>().Object)