package me.androidbox.busbymovies;

import android.support.test.espresso.assertion.ViewAssertions;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import me.androidbox.busbymovies.movielist.MovieListActivity;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withText;

/**
 * Created by steve on 2/18/17.
 */
@RunWith(AndroidJUnit4.class)
public class MovieListViewImpTest {

    @Rule
    public final ActivityTestRule<MovieListActivity> activityTestRule =
            new ActivityTestRule<>(MovieListActivity.class);

    @Test
    public void shouldDisplayCorrectTitleInToolbar() {
        onView(withText(R.string.app_name)).check(ViewAssertions.matches(isDisplayed()));
    }
}

@@ -335,16 +335,79 @@
 ctivity;
+%0Aimport me.androidbox.busbymovies.utils.RecyclerViewAssertions;
 %0A%0Aimport
@@ -539,16 +539,89 @@
 played;%0A
+import static android.support.test.espresso.matcher.ViewMatchers.withId;%0A
 import s
@@ -686,16 +686,61 @@
 ithText;
+%0Aimport static org.hamcrest.Matchers.equalTo;
 %0A%0A/**%0A *
@@ -1049,16 +1049,16 @@
 bar() %7B%0A
-
         
@@ -1144,11 +1144,193 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void shouldDisplayTwentyItemsInRecyclerView() %7B%0A        onView(withId(R.id.rvMovieList))%0A                .check(new RecyclerViewAssertions(equalTo(20)));%0A    %7D
 %0A%7D%0A

Add matcher for the recyclerview to get the number of items to compare with