Exemplo n.º 1
0
        public void ShutdownAsync_EmptiesPool()
        {
            var pool         = new GcpCallInvokerPool(TestServiceMetadata.TestService);
            var callInvoker1 = pool.GetCallInvoker("endpoint", options: null, Config1, FakeAdapter);

            // Note: *not* waiting for this to complete.
            pool.ShutdownChannelsAsync();
            var callInvoker2 = pool.GetCallInvoker("endpoint", options: null, Config1, FakeAdapter);

            Assert.NotSame(callInvoker1, callInvoker2);
        }
        public void ShutdownAsync_EmptiesPool()
        {
            var pool = new GcpCallInvokerPool(EmptyScopes);

            using (var fixture = new TestServiceFixture())
            {
                var callInvoker1 = pool.GetCallInvoker(fixture.Endpoint);
                // Note: *not* waiting for this to complete.
                pool.ShutdownChannelsAsync();
                var callInvoker2 = pool.GetCallInvoker(fixture.Endpoint);
                Assert.NotSame(callInvoker1, callInvoker2);
            }
        }