Example #1
0
        public async Task ResponseTimesOut()
        {
            var message = new MessageRequest {
                Method = "get", Path = "/blah"
            };
            var ignored = false;

            _clock.Freeze();
            _client.SendAsync(message, r =>
            {
                ignored = r.Timeout;
                return(false);
            });
            await Delay(20);

            var listeners = _client.GetListeners();

            Assert.Equal(listeners.Count, 1);
            _clock.AddMinutes(2);
            await Delay(100);

            Assert.Equal(listeners.Count, 0);
            Assert.True(ignored);
        }