Implementing ItemCell

We have tests that make sure that configCell(with:) gets called when the cell is prepared. Now, we need tests to make sure that the information is set to the label of ItemCell. You may ask, "What label?", which would be correct, as we also need tests to make sure that ItemCell has labels in order to present the information.

Select the ToDoTests group in the Project Navigator and add a new test case. Call it ItemCellTests. Add the import @testable import ToDo statement and remove the two template test methods.

To be able to present the data on the screen, ItemCell needs labels. We will add the labels in Interface Builder (IB). This means that to test whether the label is set up when the table view cell is loaded, we need ...

Get Test-Driven iOS Development with Swift 4 - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.