Пример #1
0
        public void ResizeTest(double width, double height)
        {
            var handle = new MarginHandle(_button, new AdornerPanel(), HandleOrientation.Left);
            var grid   = _button.Parent.View;

            grid.Measure(grid.DesiredSize);
            grid.Arrange(new Rect(grid.DesiredSize));
            grid.UpdateLayout();

            PlacementTests.Resize(new Rect(20, 20, width, height), _button);
            Assert.AreEqual(20, handle.HandleLength);
            Assert.IsTrue(handle.Visibility == Visibility.Visible, "Handle is not visible");
            Assert.IsTrue(handle.Stub.Visibility == Visibility.Hidden, "Stub is Visible");
        }
Пример #2
0
        public void MoveTest()
        {
            Intialize();
            var handle = new MarginHandle(_button, new AdornerPanel(), HandleOrientation.Left);
            var grid   = _button.Parent.View;

            grid.Measure(grid.DesiredSize);
            grid.Arrange(new Rect(grid.DesiredSize));
            grid.UpdateLayout();

            PlacementTests.Move(new Vector(20, 20), _button);
            Assert.AreEqual(41, handle.HandleLength);
            Assert.IsTrue(handle.Visibility == Visibility.Visible, "Handle is not visible");
            Assert.IsTrue(handle.Stub.Visibility == Visibility.Hidden, "Stub is Visible");
        }