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