public void WillCallBackAtSetInterval() { ExpirationPollTimer timer = new ExpirationPollTimer(); timer.StartPolling(new TimerCallback(CallbackMethod), 100); Thread.Sleep(1100); timer.StopPolling(); Assert.IsTrue((counter >= 9) && (counter <= 12)); }
public void CanStopPolling() { ExpirationPollTimer timer = new ExpirationPollTimer(100); timer.StartPolling(new TimerCallback(CallbackMethod)); Thread.Sleep(1100); timer.StopPolling(); Thread.Sleep(250); Assert.IsTrue((counter >= 9) && (counter <= 12)); }
public void CannotCallStopBeforeCallingStart() { ExpirationPollTimer timer = new ExpirationPollTimer(); timer.StopPolling(); }