コード例 #1
0
        public void CanMoveTo3rdRange_3Ranges()
        {
            PagerData pager = new PagerData(1, 13, new PagerSettings()
            {
                NumberPagesToDisplay = 5
            });

            CheckPages(pager, 1, 1, 1, 5, 2);
            CheckNavigation(pager, false, false, true, true);

            // Move to last page 5 in first range ( 1 - 5 )
            pager.MoveToPage(5);
            CheckPages(pager, 5, 4, 1, 5, 6);
            CheckNavigation(pager, false, false, true, true);

            // Move to first page 6 in next range ( 6 - 10 )
            pager.MoveNext();
            CheckPages(pager, 6, 5, 6, 10, 7);
            CheckNavigation(pager, true, true, true, true);

            // Move to last page 10 in 2nd range ( 6 - 10 )
            pager.MoveToPage(10);
            CheckPages(pager, 10, 9, 6, 10, 11);
            CheckNavigation(pager, true, true, true, true);

            // Move to first page 11 in last range ( 9 - 13 )
            pager.MoveNext();
            CheckPages(pager, 11, 10, 9, 13, 12);
            CheckNavigation(pager, true, true, false, false);

            // Move to previous page 10 in 2nd range ( 6 - 10 )
            pager.MovePrevious();
            CheckPages(pager, 10, 9, 6, 10, 11);
            CheckNavigation(pager, true, true, true, true);
        }
コード例 #2
0
        public void CanMoveToNextPage_SingleRange()
        {
            PagerData pager = new PagerData(1, 4);

            CheckPages(pager, 1, 1, 1, 4, 2);
            CheckNavigation(pager, false, false, false, false);

            pager.MoveNext();
            CheckPages(pager, 2, 1, 1, 4, 3);
            CheckNavigation(pager, false, false, false, false);
        }
コード例 #3
0
        public void CanMoveToNextPage_ManyRanges()
        {
            PagerData pager = new PagerData(1, 18, new PagerSettings()
            {
                NumberPagesToDisplay = 5
            });

            CheckPages(pager, 1, 1, 1, 5, 2);
            CheckNavigation(pager, false, false, true, true);

            pager.MoveNext();
            CheckPages(pager, 2, 1, 1, 5, 3);
            CheckNavigation(pager, false, false, true, true);
        }
コード例 #4
0
        public void CanMoveTo2ndRange_3Ranges()
        {
            PagerData pager = new PagerData(1, 15, new PagerSettings()
            {
                NumberPagesToDisplay = 5
            });

            CheckPages(pager, 1, 1, 1, 5, 2);
            CheckNavigation(pager, false, false, true, true);

            // Move to last page in first range ( 1 - 5 )
            pager.MoveToPage(5);
            CheckPages(pager, 5, 4, 1, 5, 6);
            CheckNavigation(pager, false, false, true, true);


            // Move to first page in next range ( 6 - 10 )
            pager.MoveNext();
            CheckPages(pager, 6, 5, 6, 10, 7);
            CheckNavigation(pager, true, true, true, true);
        }