public void Page_Rows(Int32 page, Int32 rows, Int32 expectedPage, Int32 expectedRows) { lookup.Filter.Page = page; lookup.Filter.Rows = rows; lookup.Filter.TotalRows = 1; IQueryable <TestModel> expected = lookup.GetModels().Skip(expectedPage * expectedRows).Take(expectedRows); IQueryable <TestModel> actual = lookup.Page(lookup.GetModels()); Assert.Equal(expectedPage, lookup.Filter.Page); Assert.Equal(expectedRows, lookup.Filter.Rows); Assert.Equal(200, lookup.Filter.TotalRows); Assert.Equal(expected, actual); }
public void Page_Rows(Int32 offset, Int32 rows, Int32 expectedOffset, Int32 expectedRows) { lookup.Filter.Rows = rows; lookup.Filter.Offset = offset; IQueryable <TestModel> expected = lookup.GetModels().Skip(expectedOffset).Take(expectedRows); IQueryable <TestModel> actual = lookup.Page(lookup.GetModels()); Assert.Equal(expectedOffset, lookup.Filter.Offset); Assert.Equal(expectedRows, lookup.Filter.Rows); Assert.Equal(expected, actual); }