asp.netunit-testingpaginationgrid

How to unit test a grid with paging


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.

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?


Solution

  • You will have to

    That way you can test the filtering and the paging logic in separate units.

    Next you could also use a automatic webtest to test the complete stuff (integration test).