use of org.robolectric.shadows.ShadowActivity.IntentSenderRequest in project robolectric by robolectric.
the class ShadowActivityTest method getLastIntentSenderRequest.
@Test
public void getLastIntentSenderRequest() throws IntentSender.SendIntentException {
Activity activity = Robolectric.setupActivity(Activity.class);
int requestCode = 108;
Intent intent = new Intent("action");
Intent fillInIntent = new Intent();
PendingIntent pendingIntent = PendingIntent.getActivity(systemContext, requestCode, intent, 0);
Bundle options = new Bundle();
int flagsMask = 1;
int flagsValues = 2;
int extraFlags = 3;
IntentSender intentSender = pendingIntent.getIntentSender();
activity.startIntentSenderForResult(intentSender, requestCode, fillInIntent, flagsMask, flagsValues, extraFlags, options);
IntentSenderRequest lastIntentSenderRequest = shadowOf(activity).getLastIntentSenderRequest();
assertThat(lastIntentSenderRequest.intentSender).isEqualTo(intentSender);
assertThat(lastIntentSenderRequest.fillInIntent).isEqualTo(fillInIntent);
assertThat(lastIntentSenderRequest.requestCode).isEqualTo(requestCode);
assertThat(lastIntentSenderRequest.flagsMask).isEqualTo(flagsMask);
assertThat(lastIntentSenderRequest.flagsValues).isEqualTo(flagsValues);
assertThat(lastIntentSenderRequest.extraFlags).isEqualTo(extraFlags);
assertThat(lastIntentSenderRequest.options).isEqualTo(options);
}
Aggregations