Unit testing is taking a piece of code and testing it independently without any other dependencies or parts of the system running (for example the database).
Robolectric is a unit test framework that de-fangs the Android SDK jar so you can test-drive the development of your Android app. Tests run inside the JVM on your workstation in seconds.
Combing them both allows you to run fast tests on the JVN still using the Android API's.
To configure robolectric add
@Config annotation to test class or method.
Run with custom Application class
Set target SDK
Run with custom manifest
When specified, robolectric will look relative to the current directory.
Default value is
Resources and assets will be loaded relative to the manifest.
Possible qualifiers can be found in android docs.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0