// Path: src/main/java/com/nikhaldimann/viewselector/ViewSelectorAssertions.java
// public static ViewSelectionAssert assertThatSelection(String selector, Activity activity) {
//     return assertThat(selection(selector, activity));
// }
// 
// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/ListViewExampleActivity.java
// public class ListViewExampleActivity extends Activity {
// 
//     private ArrayAdapter<String> listAdapter;
//     private List<String> groceries;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_list_view);
// 
//         ListView list = (ListView) this.findViewById(R.id.groceries);
//         groceries = new ArrayList<String>();
//         listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, groceries);
//         list.setAdapter(listAdapter);
//     }
// 
//     /**
//      * Adds an item to the grocery list.
//      */
//     public void addGroceryItem(String item) {
//         groceries.add(item);
//         listAdapter.notifyDataSetChanged();
//     }
// 
// }


import static com.nikhaldimann.viewselector.ViewSelectorAssertions.assertThatSelection;
import android.test.ActivityInstrumentationTestCase2;
import com.nikhaldimann.viewselector.test.ListViewExampleActivity;
package com.nikhaldimann.viewselector.android.activities;




/**
 * Example unit test for an activity with a dynamic list view. The activity has
 * a ListView with the id "groceries". We can add items to the list.
 *
 * Keep this example self-contained so it can be referenced from documentation.
 */
public class ListViewExampleActivityTest extends ActivityInstrumentationTestCase2<ListViewExampleActivity> {

    private ListViewExampleActivity activity;

    public ListViewExampleActivityTest() {
        super(ListViewExampleActivity.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        activity = getActivity();
    }

    public void testListView() {
        // Assert that there is a ListView with id "groceries" in this activity
// Path: src/main/java/com/nikhaldimann/viewselector/ViewSelectorAssertions.java
// public static ViewSelectionAssert assertThatSelection(String selector, Activity activity) {
//     return assertThat(selection(selector, activity));
// }
// 
// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/ListViewExampleActivity.java
// public class ListViewExampleActivity extends Activity {
// 
//     private ArrayAdapter<String> listAdapter;
//     private List<String> groceries;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_list_view);
// 
//         ListView list = (ListView) this.findViewById(R.id.groceries);
//         groceries = new ArrayList<String>();
//         listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, groceries);
//         list.setAdapter(listAdapter);
//     }
// 
//     /**
//      * Adds an item to the grocery list.
//      */
//     public void addGroceryItem(String item) {
//         groceries.add(item);
//         listAdapter.notifyDataSetChanged();
//     }
// 
// }


// Path: src/android-test/src/com/nikhaldimann/viewselector/android/activities/ListViewExampleActivityTest.java
import static com.nikhaldimann.viewselector.ViewSelectorAssertions.assertThatSelection;
import android.test.ActivityInstrumentationTestCase2;
import com.nikhaldimann.viewselector.test.ListViewExampleActivity;

package com.nikhaldimann.viewselector.android.activities;




/**
 * Example unit test for an activity with a dynamic list view. The activity has
 * a ListView with the id "groceries". We can add items to the list.
 *
 * Keep this example self-contained so it can be referenced from documentation.
 */
public class ListViewExampleActivityTest extends ActivityInstrumentationTestCase2<ListViewExampleActivity> {

    private ListViewExampleActivity activity;

    public ListViewExampleActivityTest() {
        super(ListViewExampleActivity.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        activity = getActivity();
    }

    public void testListView() {
        // Assert that there is a ListView with id "groceries" in this activity
        assertThatSelection("ListView#groceries", activity).hasSize(1);