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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.