The following is the first few sections of a chapter from Exploring Android, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


Testing Our Repository

Right now, we have no idea if our ToDoRepository works. Probably it does. After all, there is not much to the code. Besides, this is a book, and books never have mistakes, right?

(right?!?)

In the real world, though, you do not have a set of tutorials for every bit of code that you want to write. Along the way, writing tests will help you confirm that the code that you wrote actually works. So, in this tutorial, we will start adding some tests to our project.

This is a continuation of the work we did in the previous tutorial. The book’s GitHub repository contains the results of the previous tutorial as well as the results of completing the work in this tutorial.

Read Me!

This tutorial assumes that you have learned about JUnit 4 and instrumentation tests from somewhere. That could be:

Step #1: Examine Our Existing Tests

The preview of this section was fed to a gremlin, after midnight.

Step #2: Decide on Instrumentation Tests vs. Unit Tests

The preview of this section took that left turn at Albuquerque.

Step #3: Rename the Test Case

The preview of this section is sleeping in.

Step #4: Test the Repository

The preview of this section is in the process of being translated from its native Klingon.

Step #5: Run the Test Case

The preview of this section was fed to a gremlin, after midnight.

Step #6: Fix the Repository

The preview of this section may contain nuts.

What We Changed

The preview of this section is in an invisible, microscopic font.