コード例 #1
0
 @Test
 public void testOnItemClick_startsFullPhotoViewIntent() {
   subject.setupPhotoList();
   RecyclerView recyclerView = subject.getPhotoRecyclerView();
   recyclerView.measure(0, 0);
   recyclerView.layout(0, 0, 100, 1000);
   RecyclerView.ViewHolder viewHolder = recyclerView.findViewHolderForAdapterPosition(0);
   View view = viewHolder.itemView;
   view.performClick();
   Intent expectedIntent = new Intent(subject, PhotoFullScreenActivity.class);
   ShadowActivity shadowActivity = Shadows.shadowOf(subject);
   Intent actualIntent = shadowActivity.getNextStartedActivity();
   Assertions.assertThat(actualIntent).isNotNull();
   assertTrue(actualIntent.filterEquals(expectedIntent));
 }
コード例 #2
0
 @Test
 public void testOnCreate_setsUpPhotoListView() {
   ANDROID.assertThat(subject.getPhotoRecyclerView()).isNotNull();
 }