public void FilterSortPaginateFilters() { List <String> headers = SampleHorseData.GetSampleHeaders(); List <List <string> > tableData = SampleHorseData.GetSampleTableData(); List <FilterMetadata> filters = new List <FilterMetadata> { new FilterMetadata("Colour", "Bay") }; SortMetadata sortMetadata = null; PaginationMetadata paginationMetadata = null; var expectedTableData = new List <List <string> > { new List <string> { "Thoroughbred", "Bay", "1.66", "3", "true" }, new List <string> { "Arabian horse", "Bay", "1.51", "5", "true" } }; PaginatedTable table = Horse.FilterSortPaginateTable(headers, tableData, filters, sortMetadata, paginationMetadata); table.Headers.ShouldBe(headers); table.TotalRows.ShouldBe(2); table.TableData.ShouldBe(expectedTableData); }
public void FilterSortPaginate() { List <String> headers = SampleHorseData.GetSampleHeaders(); List <List <Object> > tableData = SampleHorseData.GetSampleTableData(); List <FilterMetadata> filters = SampleHorseData.GetSampleFilters(); SortMetadata sortMetadata = SampleHorseData.GetSampleSortMetadata(); PaginationMetadata paginationMetadata = SampleHorseData.GetSamplePaginationMetadata(); var expectedTableData = new List <List <string> > { new List <string> { "Thoroughbred", "Bay", "1.6", "3", "true" }, new List <string> { "Thoroughbred", "Grey", "1.55", "3", "true" } }; PaginatedTable table = Horse.FilterSortPaginateTable(headers, tableData, filters, sortMetadata, paginationMetadata); table.Headers.ShouldBe(headers); table.TotalRows.ShouldBe(2); table.TableData.ShouldBe(expectedTableData); }