Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);
like image 930
Durgesh Patel Avatar asked Jun 11 '15 10:06

Durgesh Patel


1 Answers

You need to use Shadows.shadowOf(), it changed in Robolectric 3.0. For further reference about other changes, see this guide

like image 167
J.C. Chaparro Avatar answered Nov 14 '22 04:11

J.C. Chaparro