Reputation: 1105
I am using Eclipse IDE with Robolectric unit test case framework (robolectric-3.0-rc3.jar) to write unit test case in android application test project.
MainActivity activity = Robolectric.setupActivity(MainActivity.class);
activity.findViewById(R.id.myvideoview).performClick();
Intent expectedIntent = new Intent(activity, CategoryActivity.class);
assertThat(shadowOf(activity).getNextStartedActivity()).isEqualTo(expectedIntent);
Upvotes: 5
Views: 3515
Reputation: 1079
You need to use Shadows.shadowOf()
, it changed in Robolectric 3.0.
For further reference about other changes, see this guide
Upvotes: 14