A common web UI design is to display a sortable grid (GridView, ListView, DataGrid) with paging. That is, the user can click on any column header to cause the records to be sorted in ascending or descending order on that column's data. And, the user can navigate among the pages of, say, 10 records at a time.
- There may be millions of database records that could potentially be displayed on the grid.
- There are many possible filters that could be applied to the data selection. The displayed records might apply to the current user, or to a date range, or to a customer, department, product, order.
- The user can sort the displayed records on any column, and they can navigate among pages.
How would you write a unit test(s) to confirm that the selected records are the correct records, for this filter, this page, and this sort order?