public void HasValidFirstAndLastPages() { PageNumberAndSizeTests.AssertIsFirstPage(this.defaultPagingInfo.CurrentPage); PageNumberAndSizeTests.AssertIsFirstPage(this.defaultPagingInfo.FirstPage); AssertIsFirstPage(this.defaultPagingInfo); AssertIsLastPage(this.defaultPagingInfo); Assert.AreEqual(20, this.defaultPagingInfo.CurrentPage.Size); Assert.AreEqual(20, this.defaultPagingInfo.FirstPage.Size); Assert.AreEqual(this.defaultPagingInfo.TotalItems, this.defaultPagingInfo.ItemCount); Assert.IsNull(this.defaultPagingInfo.AllPages); Assert.IsTrue(this.defaultPagingInfo.IsFirstPage); Assert.IsTrue(this.defaultPagingInfo.IsLastPage); }
internal static void AssertIsFirstPage(PagingInfo firstPageInfo) { PageNumberAndSizeTests.AssertIsFirstPage(firstPageInfo.CurrentPage); Assert.AreEqual(0, firstPageInfo.CurrentPage.Index); Assert.AreEqual( PageNumberAndSize.FirstPageNumber, firstPageInfo.CurrentPage.Number); Assert.IsTrue(firstPageInfo.HasValue); Assert.IsFalse(firstPageInfo.PreviousPage.HasValue); Assert.IsTrue(firstPageInfo.IsFirstPage); PageNumberAndSizeTests.AssertEquality( firstPageInfo.FirstPage, firstPageInfo.CurrentPage); }
public void HasValidFirstAndLastPages() { AssertIsFirstPage(this.defaultPagingInfo); PageNumberAndSizeTests.AssertIsFirstPage(this.defaultPagingInfo.CurrentPage); PageNumberAndSizeTests.AssertIsFirstPage(this.defaultPagingInfo.FirstPage); Assert.Greater(this.defaultPagingInfo.CurrentPage.Size, byte.MinValue); Assert.Greater(this.defaultPagingInfo.FirstPage.Size, byte.MinValue); Assert.Greater(this.defaultPagingInfo.LastPage.Size, byte.MinValue); Assert.IsNull(this.defaultPagingInfo.AllPages); Assert.AreEqual(PageNumberAndSize.DefaultPageSize, this.defaultPagingInfo.ItemCount); Assert.AreEqual(PageNumberAndSize.DefaultPageSize, this.defaultPagingInfo.CurrentPage.Size); Assert.AreEqual(this.defaultPagingInfo.CurrentPage.Size, this.defaultPagingInfo.FirstPage.Size); Assert.AreEqual(this.defaultPagingInfo.CurrentPage.Size, this.defaultPagingInfo.LastPage.Size); Assert.AreEqual(this.defaultPagingInfo.CurrentPage.Size, this.defaultPagingInfo.ItemCount); }