July 2018
Intermediate to advanced
242 pages
8h 6m
English
Apart from behavior-mocking, Mockito Kotlin provides a reliable way of verifying interactions with mocked dependencies that occurred while executing the test method. In both the `should display success message when email address is available`() and `should display error message when email address isn't available`() functions, we just want to check whether the desired function of the TextView dependency was invoked. In order to do this, we are invoking the verify() function. For example, in order to check whether the showErrorMessage() function has been called on the mocked view: TextView dependency, we call the following code:
verify(view).showErrorMessage(anyString())
If the showErrorMessage() is not invoked, the test method ...
Read now
Unlock full access