Code example for ListView

Methods: getAdapter

0
 
    @Test 
    public void shouldSetAdapterOnListView() throws Exception { 
        ListAdapter adapter = new CountingAdapter(5);
        listActivity.setListAdapter(adapter);
        assertThat(listView.getAdapter()).isSameAs(adapter);
    } 
 
    @Test(expected = RuntimeException.class) 
    public void whenNoViewWithListIdExists_shouldRaiseException(){ 
        ListActivity listActivity = new ListActivity();
        listActivity.setListAdapter(new CountingAdapter(5));
    } 
}