public void MoveTest() { var rand = new System.Random(); var max_cursor_range = 0xFFF; var min_cursor_range = -0xFFF; var start = Cursor.Position; foreach (int i in Enumerable.Range(0, 100)) { mouseEvents.Clear(); var dx = rand.Next(max_cursor_range - min_cursor_range) - min_cursor_range; var dy = rand.Next(max_cursor_range - min_cursor_range) - min_cursor_range; sender.Move(dx, dy); var evnt = mouseEvents[0].Item1; var pos = mouseEvents[0].Item2.pt; Assert.AreEqual(evnt, LowLevelMouseHook.Event.WM_MOUSEMOVE); Assert.AreEqual(pos.x, start.X + dx); Assert.AreEqual(pos.y, start.Y + dy); } }