This is an ongoing series on writing Unit tests with best practices where we develop a TODO app with Effective tests.
This article covers implementation of Add task screen with unit tests. We will also see how we can navigate back and forth very easily with UIPilot and how to write tests for navigation.
This post is divided into 6 small steps to make explanation easier.
- Make UIPilot available in ViewModel
- Add button on list screen
- Implement Add Task screen UI
- Implement Add Task ViewModel
- Write tests for Add Task ViewModel
- Refresh list screen after task is added
Feel free to jump/skip steps you are already familiar with.
Check out the source code on Github.
Check out full article to write iOS unit test with best practices.