In my last post, you learned how to test your presenter and format data properly for display. We also introduced a new displayFetchedOrders()
method in the view controller. The purpose of this method is to gather the fetched orders in the view model and set the contents in the IBOutlet
s.
But we left the displayFetchedOrders()
method empty because we focused on testing the presenter. We needed to make sure we were formatting the order date to the format we want and combine first and last names.
Now, let’s finish up by test driving the displayFetchedOrders()
method so we can actually see the displayed orders in the UI.
We’ll follow the same TDD steps that you have been accustomed to in the last few posts:
- Isolate the dependencies
- Write the test first
- Draw the boundary
- Implement the logic