Beispiel #1
0
        public async Task When_VerticalScrollViewer_NotScrolled_Top()
        {
            VerticalScrollViewer.ChangeView(0, 0, null, disableAnimation: true);
            await Task.Delay(25);

            var sut = ScrollTop.TransformToVisual(VerticalScrollViewerParent);

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

            Assert.AreEqual(new Rect(0, 0, 50, 50), result);
        }
Beispiel #2
0
        public async Task When_VerticalScrollViewer_Scrolled_Top()
        {
            var offset = _svExtent - _svHeight;

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

            var sut = ScrollTop.TransformToVisual(VerticalScrollViewerParent);

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

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