예제 #1
0
        public void TestWithoutEstablisher()
        {
            Assert.AreNotEqual(ChannelState.Ready, _channel.State);
            var establisher = new Services.Models.GrpcConnectionEstablisher(_channel);

            Assert.AreEqual(establisher.Connected, false);
        }
예제 #2
0
        public void TestWithEstablisher()
        {
            var establisher = new Services.Models.GrpcConnectionEstablisher(_channel);

            establisher.StartKeepAlive();
            Task.Delay(1000).Wait();
            Assert.IsTrue(establisher.Connected);
            for (int i = 0; i < 8; i++)
            {
                Task.Delay(TimeSpan.FromMinutes(1)).Wait();
                Assert.IsTrue(establisher.Connected);
            }
            establisher.StopKeepAlive();
            establisher.Dispose();
        }
예제 #3
0
        public void TestShutdown()
        {
            var establisher = new Services.Models.GrpcConnectionEstablisher(_channel);

            establisher.StartKeepAlive();

            Task.Delay(1000).Wait();

            Assert.IsTrue(establisher.Connected);

            _channel.ShutdownAsync().Wait();

            Assert.IsFalse(establisher.Connected);

            establisher.StopKeepAlive();
            establisher.Dispose();
        }