Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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());
        }