Code example for View

Methods: getId, getTop

0
        assertEquals("Selection still available after touch", -1, 
                mListView.getSelectedItemPosition());
         
        View firstChild = mListView.getChildAt(0);
         
        assertEquals("Item zero not the first child in the list", 0, firstChild.getId());
         
        assertEquals("Item zero not at the top of the list", mListView.getListPaddingTop(),
                firstChild.getTop());
         
        assertTrue(String.format("Too many children created: %d expected no more than %d", 
                mListView.getChildCount(), originalCount + 1), 
                mListView.getChildCount() <= originalCount + 1);
    } 
     
    @MediumTest 
    public void testPushUp() { 
        TouchUtils.scrollToBottom(this, mListView);
 
        // Nothing should be selected 
        assertEquals("Selection still available after touch", -1,