public void GetDefaultPagedList_NoCount(int pageIndex) { var option = Options.Create(new PagerSetupOption { StartPageIndex = pageIndex, DefaultPageSize = 10 }); var pager = new PagerService(option); var orderedData = _list.AsQueryable().OrderBy(x => x.Seq); var rs = pager.GetPagedList(orderedData, false); Assert.Equal(-1, rs.RecordCount); Assert.Equal(-1, rs.PageCount); Assert.Equal(orderedData.First().Seq, rs.Data.First().Seq); }
public void GetDefaultPagedList_OutRange(int pageIndex) { var option = Options.Create(new PagerSetupOption { StartPageIndex = pageIndex, DefaultPageSize = 10 }); var pager = new PagerService(option); var orderedData = _list.AsQueryable().OrderBy(x => x.Seq); var rs = pager.GetPagedList(orderedData, new PagerParams { PageIndex = pageIndex + 12, PageSize = 10 }); Assert.Equal(100, rs.RecordCount); Assert.Equal(10, rs.PageCount); Assert.Empty(rs.Data); }