@@ -0,0 +1,1917 @@
+package net.gouline.dagger2demo.activity;%0A%0Aimport android.support.v7.widget.RecyclerView;%0Aimport android.test.ActivityInstrumentationTestCase2;%0Aimport android.widget.TextView;%0A%0Aimport net.gouline.dagger2demo.R;%0Aimport net.gouline.dagger2demo.rest.ITunesService;%0A%0A/**%0A * Mostly following:%0A *  http://developer.android.com/training/activity-testing/preparing-activity-testing.html%0A *  http://developer.android.com/training/activity-testing/activity-basic-testing.html%0A *%0A * Created by clkim on 10/19/15%0A */%0Apublic class AlbumSearchActivityTest extends ActivityInstrumentationTestCase2%3CAlbumSearchActivity%3E %7B%0A    private AlbumSearchActivity albumSearchActivity;%0A    private RecyclerView recyclerView;%0A    private TextView emptyView;%0A    private ITunesService mITunesService;%0A%0A    public AlbumSearchActivityTest() %7B%0A        super(AlbumSearchActivity.class);%0A    %7D%0A%0A    @Override%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A        albumSearchActivity = getActivity();%0A        recyclerView = (RecyclerView) albumSearchActivity.findViewById(R.id.recycler_view);%0A        emptyView = (TextView) albumSearchActivity.findViewById(R.id.empty_view);%0A%0A        // accessing a Kotlin var in Activity class by the property name%0A        //  IDE also offers getter getmITunesService()%0A        mITunesService = albumSearchActivity.mITunesService;%0A    %7D%0A%0A    public void testPreConditions() %7B%0A        assertNotNull(albumSearchActivity);%0A        assertNotNull(recyclerView);%0A        assertNotNull(emptyView);%0A    %7D%0A%0A    public void testITuneServiceIsInjected() %7B%0A        // test for successful Dagger 2 injection in the Activity class%0A        assertNotNull(mITunesService);%0A    %7D%0A%0A    public void testEmptyTextView_labelText() %7B%0A        String expected = albumSearchActivity.getString(R.string.search_empty);%0A        String actual = emptyView.getText().toString();%0A        assertEquals(expected, actual);%0A    %7D%0A%7D%0A

Add basic unit tests for Activity