Esempio n. 1
0
        public async Task When_HorizontalScrollViewer_NotScrolled_Left()
        {
            HorizontalScrollViewer.ChangeView(0, 0, null, disableAnimation: true);
            await Task.Delay(25);

            var sut = ScrollLeft.TransformToVisual(HorizontalScrollViewerParent);

            var result = sut.TransformBounds(new Rect(0, 0, 50, 50));

            Assert.AreEqual(new Rect(0, 0, 50, 50), result);
        }
Esempio n. 2
0
        public async Task When_HorizontalScrollViewer_NotScrolled_Right()
        {
            HorizontalScrollViewer.ChangeView(0, 0, null, disableAnimation: true);
            await Task.Delay(25);

            var sut = ScrollRight.TransformToVisual(HorizontalScrollViewerParent);

            var result = sut.TransformBounds(new Rect(ScrollRight.ActualWidth, 0, 50, 50));

            Assert.IsTrue(RectCloseComparer.UI.Equals(new Rect(_svExtent, 0, 50, 50), result));
        }
Esempio n. 3
0
        public async Task When_HorizontalScrollViewer_Scrolled_Right()
        {
            var offset = _svExtent - _svWidth;

            HorizontalScrollViewer.ChangeView(offset, 0, null, disableAnimation: true);
            await Task.Delay(25);

            var sut = ScrollRight.TransformToVisual(HorizontalScrollViewerParent);

            var result = sut.TransformBounds(new Rect(ScrollRight.ActualWidth, 0, 50, 50));

            Assert.AreEqual(new Rect(_svWidth, 0, 50, 50), result);
        }
Esempio n. 4
0
        public async Task When_HorizontalScrollViewer_Scrolled_Left()
        {
            var offset = _svExtent - _svWidth;

            HorizontalScrollViewer.ChangeView(offset, 0, null, disableAnimation: true);
            await Task.Delay(25);

            var sut = ScrollLeft.TransformToVisual(HorizontalScrollViewerParent);

            var result = sut.TransformBounds(new Rect(0, 0, 50, 50));

            Assert.IsTrue(RectCloseComparer.UI.Equals(new Rect(-offset, 0, 50, 50), result));
        }