public void CallbackFromTimerWithCancel() { var mocks = new MockRepository(); var action = mocks.CreateMock <Action>(); var timer = new TimerAction(action, 2, Timeout.Infinite); var registry = mocks.CreateMock <ISchedulerRegistry>(); registry.Remove(timer); registry.Enqueue(timer.ExecuteOnFiberThread); mocks.ReplayAll(); timer.ExecuteOnTimerThread(registry); }
public void CallbackFromIntervalTimerWithCancel() { var mocks = new MockRepository(); var action = mocks.CreateMock <Action>(); var timer = new TimerAction(action, 2, 3); var registry = mocks.CreateMock <ISchedulerRegistry>(); registry.Remove(timer); mocks.ReplayAll(); timer.Dispose(); timer.ExecuteOnTimerThread(registry); }