Beispiel #1
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();
        }
Beispiel #2
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();
        }