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); }
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); }
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); }