public void DragMove_FiresAndPropagates() { MockApplication testView = MockApplication.Setup <DragHandlerTestThing_Move>(); testView.Update(); testView.SetViewportRect(new Rect(0, 0, 1000, 1000)); DragHandlerTestThing_Move root = (DragHandlerTestThing_Move)testView.RootElement; testView.InputSystem.MouseDown(new Vector2(10, 10)); testView.Update(); testView.InputSystem.MouseDragMove(new Vector2(30, 30)); testView.Update(); Assert.AreEqual(new string[0], root.dragList.ToArray()); testView.InputSystem.MouseDragMove(new Vector2(30, 20)); testView.Update(); Assert.AreEqual(new[] { "move:child0" }, root.dragList.ToArray()); }
public void DragMove_DoesNotFireAgainWhenNotMovedAndContains() { MockApplication testView = MockApplication.Setup <DragHandlerTestThing_Move>(); testView.Update(); testView.SetViewportRect(new Rect(0, 0, 1000, 1000)); DragHandlerTestThing_Move root = (DragHandlerTestThing_Move)testView.RootElement; testView.InputSystem.MouseDown(new Vector2(10, 10)); testView.Update(); testView.InputSystem.MouseDragMove(new Vector2(30, 30)); testView.Update(); testView.InputSystem.MouseDragMove(new Vector2(31, 20)); testView.Update(); testView.InputSystem.MouseDragMove(new Vector2(31, 20)); testView.Update(); Assert.AreEqual(new[] { "move:child0", "hover:child0" }, root.dragList.ToArray()); }