public async Task AddPooledService() { Snapshot.FullName(); var pooledService = new SayHelloServicePool(); await new ServiceCollection() .AddSingleton <ObjectPool <SayHelloService> >(pooledService) .AddGraphQL() .AddQueryType <QueryPooledService>() .ModifyRequestOptions(o => o.IncludeExceptionDetails = true) .ExecuteRequestAsync("{ sayHello }") .MatchSnapshotAsync(); Assert.True(pooledService.GetService); Assert.True(pooledService.ReturnService); }
public async Task AddPooledService() { Snapshot.FullName(); var pooledService = new SayHelloServicePool(); await new ServiceCollection() .AddSingleton <ObjectPool <SayHelloService> >(pooledService) .AddGraphQL() .AddQueryType <QueryWellKnownService>() .RegisterService <SayHelloService>(ServiceKind.Pooled) .ExecuteRequestAsync("{ sayHello }") .MatchSnapshotAsync(); Assert.True(pooledService.GetService); Assert.True(pooledService.ReturnService); }