You can use the following activities to sink this chapter into your brain. Start with the first. Work down as far as you want to go.
Search your code for any classes that use table views. Add tests to ensure that their data sources and delegates are non-nil.
Choose a simple table with one kind of cell. Write a test that creates a data model, then checks the number of rows.
Write another test that gets a cell. Use a guard let to cast the cell to your cell subclass. If the cast is unsuccessful, report the failure with XCTFail and do an early return. Otherwise, test that the cell contents are correct.
Extract helper functions to simplify the data source tests. Put these helpers in a file of test helpers you can use across your test suites.
Expand your testing into table view delegate methods that handle cell selection. For example, if selecting a cell pushes another view controller, apply Chapter 10, Testing Navigation Between Screens (as long as you’re not using segues).