示例#1
0
            public void AllowsTurningPastLastPage()
            {
                PagingInfo        validPagingInfo = new PagingInfo(3, 10, 57);
                PageNumberAndSize newPage         = validPagingInfo.TurnToPage(8);

                Assert.AreEqual(8, newPage.Number);
                Assert.AreEqual(10, newPage.Size);
                Assert.IsFalse(newPage.IsUnbounded);
            }
示例#2
0
            public void ReturnsUnboundedFromUnbounded()
            {
                PagingInfo        unboundedPagingInfo = new PagingInfo(PageNumberAndSize.Unbounded, 57);
                PageNumberAndSize newPage             = unboundedPagingInfo.TurnToPage(8);

                Assert.AreEqual(1, newPage.Number);
                Assert.AreEqual(0, newPage.Size);
                Assert.IsTrue(newPage.IsUnbounded);
            }
示例#3
0
            public void DefaultCaseReusesSize()
            {
                PagingInfo        validPagingInfo = new PagingInfo(3, 10, 57);
                PageNumberAndSize newPage         = validPagingInfo.TurnToPage(2);

                Assert.AreEqual(2, newPage.Number);
                Assert.AreEqual(10, newPage.Size);
                Assert.IsFalse(newPage.IsUnbounded);
            }