public void TestCancellation() { timeBasedCommand.SetCommand("foo", 1000); Thread.Sleep(200); Assert.AreSame(timeBasedCommand.CurrentCommand, "foo", "Command after adding it"); timeBasedCommand.CancelCurrentCommand(); Thread.Sleep(200); // Event must have been cancelled by now Assert.IsNull(timeBasedCommand.CurrentCommand, "Command after cancellation"); }
public override void CancelEvents() { timeBasedCommand.CancelCurrentCommand(); lastCommand = null; }