Extensive use of mock objects

In the previous chapters, we described and used the mock classes that are present in the Android SDK. While these classes can cover a great number of cases, there are other Android classes and your own domain classes to consider. You might have the need for other mock objects to furnish your test cases.

Several libraries provide the infrastructure to satisfy our mocking needs, but we are now concentrating on Mockito, which is perhaps the most widely used library in Android.

Note

This is not a Mockito tutorial. We will just be analyzing its use in Android, so if you are not familiar with it, I would recommend that you take a look at the documentation available on its website at https://code.google.com/p/mockito/.

Mockito ...

Get Learning Android Application Testing 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.