public void StopWrongStateTest() { var tracker = new HoverTracker(); Assert.IsFalse(tracker.Tracking); tracker.Stop(); Assert.IsFalse(tracker.Tracking); }
public void CommonTrackingTest() { var tracker = new HoverTracker(); var ctrl = new Button(); var wnd = new Popup(new Button()); Assert.IsFalse(tracker.Tracking); tracker.Start(ctrl, wnd); Assert.IsTrue(tracker.Tracking); Assert.AreEqual(ctrl, tracker.Control); Assert.AreEqual(wnd, tracker.Popup); tracker.Stop(); Assert.IsFalse(tracker.Tracking); Assert.IsNull(tracker.Control); Assert.IsNull(tracker.Popup); }
public void FireTrackingStoppedOnStopTest() { var tracker = new HoverTracker(); var ctrl = new Button(); var wnd = new Popup(new Button()); var eventCatcher = new EventCatcher(); tracker.TrackingStopped += eventCatcher.OnTrackingStopped; tracker.Start(ctrl, wnd); Assert.AreEqual(0, eventCatcher.Fired); tracker.Stop(); Assert.AreEqual(1, eventCatcher.Fired); Assert.IsNotNull(eventCatcher.Ev); Assert.AreEqual(ctrl, eventCatcher.Ev.Control); Assert.AreEqual(wnd, eventCatcher.Ev.Popup); }