Your first test

You will first work on displaying the notes to the user. The notes presenter will provide the logic showing a progress indicator, which displays the notes and other note-related views.

Since the Presenter coordinates between the Model and View, you will have to mock them so you can focus on the class under test.

In this test, you will verify that asking the NotesPresenter to Add a new note will trigger a call to the View to show the add-note screen. Let's implement the `should display note when button is clicked`() test method.

You will first add a call to the presenter's addNewNote() method. Then, you will verify that the View's showAddNote() is called. Therefore, you call on one method and verify that it, in turn, calls ...

Get Learning Kotlin by building Android Applications now with O’Reilly online learning.

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