Skip to content

Instantly share code, notes, and snippets.

@hkhc
Created February 26, 2018 14:57
Show Gist options
  • Save hkhc/15c22c9eb3c8603e5fa2328e5d88cd47 to your computer and use it in GitHub Desktop.
Save hkhc/15c22c9eb3c8603e5fa2328e5d88cd47 to your computer and use it in GitHub Desktop.
/*
* Find the AndroidManifest.xml at
* 1. Java resource, or
* 2. build/intermediates/manifests/[full or fast-start]/[build-type],
* which is generated by merging the AndroidManifest.xml files in
* src/main or source folder of other build variants.
*/
@Runner(RobolectricTestRunner.class)
@Config(manifest="AndroidManifest.xml")
public class ExampleTest {
@Test
public void testResources() throws Exception {
Drawable drawable = RuntimeEnvironment.application.getResources()
.getDrawable(R.drawable.app_icon);
assertNotNull(drawable);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment