| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
You should start by reading the Testing chapter in the Android documentation.
You may run your tests on a real environment, such as an emulator or a device. However, if you need fast running tests, you should definitely have a look at Robolectric an out-of-container test frameworks that runs within JUnit. It is absolutely needed if you use a continuous test runner, such as infinitest.
For instrumentation / integration tests, have a look at Robotium.
At first, you may find it hard to unit test your components written using AndroidAnnotations. Here are a few key points that should help you:
MyActivity_ activity = Robolectric.setupActivity(MyActivity_.class);
// onCreate is called, myDependency gets injected
// you reinject myDependency
activity.myDependency = Mockito.mock(MyDependency.class);| Back | FazBrowse Home | New Git URL |