示例#1
0
        public void GivenPageWithHalfPageExpected_WhenGetNextPageIndexCalled_ThenNextPageIndexIsRecalculatedCorrectly()
        {
            var currentPageIndex = 5;
            var newPageIndex     = PageAdjuster.GetNextPageIndex(new PageInfo(currentPageIndex, DefaultPageSize), 125);

            newPageIndex.Should().Be(currentPageIndex * 2 - 1);
        }
示例#2
0
        public void GivenFirstPageWithHalfPageExpected_WhenGetNextPageIndexCalled_ThenNextPageIndexIsTheSame()
        {
            var firstPageIndex = 1;
            var newPageIndex   = PageAdjuster.GetNextPageIndex(new PageInfo(firstPageIndex, DefaultPageSize), 125);

            newPageIndex.Should().Be(firstPageIndex);
        }
        public void GivenPageWithIndexHigherThanFirst_WhenGetNextPageIndexWithDecreasedPageSizeTwiceIsCalled_ThenNextPageIndexIsRecalculatedCorrectly()
        {
            var currentPageIndex = 5;
            var newPageIndex     = PageAdjuster.GetNextPageIndex(new PageInfo(currentPageIndex, DefaultPageSize), 125);

            newPageIndex.Should().Be(currentPageIndex * 2 - 1);
        }
        public void GivenPageWithFirstIndex_WhenGetNextPageIndexWithDecreasedPageSizeTwiceIsCalled_ThenNextPageIndexIsTheSame()
        {
            var firstPageIndex = 1;
            var newPageIndex   = PageAdjuster.GetNextPageIndex(new PageInfo(firstPageIndex, DefaultPageSize), 125);

            newPageIndex.Should().Be(firstPageIndex);
        }
        public void GivenPageWithDecreasedTwiceDefaultPageSize_WhenGetNextPageIndexWithDecreasedPageSizeTwiceIsCalled_ThenNextPageIndexIsCalculatedCorrectly()
        {
            var currentPageIndex = 5;
            var currentPageSize  = DefaultPageSize / 2;
            var halfPageSize     = currentPageSize / 2;
            var newPageIndex     = PageAdjuster.GetNextPageIndex(new PageInfo(currentPageIndex, currentPageSize), halfPageSize);

            newPageIndex.Should().Be(currentPageIndex * 2 - 1);
        }