public void FreezesAndIncrements() { var baseTime = new DateTime(2016, 10, 10); var clock = new FakeClock(baseTime, freeze: true); clock.AddMinutes(2); Assert.Equal(baseTime.AddMinutes(2), clock.Now); }
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); }