Durgesh Patel
Durgesh Patel

Reputation: 1105

shadowOf() undefined in Robolectric-3.0-rc3.jar

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

Answers (1)

J.C. Chaparro
J.C. Chaparro

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

Related Questions