Skip to content

Instantly share code, notes, and snippets.

@rsicarelli
Created November 7, 2016 15:34
Show Gist options
  • Save rsicarelli/7b31bdb40dbab137ae7e01701af7477a to your computer and use it in GitHub Desktop.
Save rsicarelli/7b31bdb40dbab137ae7e01701af7477a to your computer and use it in GitHub Desktop.
public static Intent getCallingIntent(Context context, ArrayList<GalleryPhoto> imagesOnDevice) {
Intent intent = new Intent(context, GalleryActivity.class);
intent.putParcelableArrayListExtra(EXTRA_IMAGES_ON_DEVICE, imagesOnDevice);
return intent;
}
...
@Test
public void someTest() {
Instrumentation.ActivityResult result = getActivityResult(dataFakeForActivity);
intending(hasExtra(GalleryActivity.EXTRA_IMAGES_ON_DEVICE)).respondWith(result);
onView(withId(R.id.gallery)).perform(click());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment