Code example for View

Methods: getClass, getHeight, getWidth

0
        assertNotNull(mFrameLayout);
        assertNotNull(mAbsoluteLayout);
    } 
     
    public void doMinimumSizeTest(View view) throws Exception {
        assertTrue(view.getClass().getSimpleName() + " should respect the background Drawable's minimum width",
                view.getWidth() >= mBackgroundDrawable.getMinimumWidth());
        assertTrue(view.getClass().getSimpleName() + " should respect the background Drawable's minimum height",
                view.getHeight() >= mBackgroundDrawable.getMinimumHeight());
    } 
 
    @MediumTest 
    public void testTextViewMinimumSize() throws Exception { 
        doMinimumSizeTest(mTextView);
    } 
     
    @MediumTest 
    public void testLinearLayoutMinimumSize() throws Exception { 
        doMinimumSizeTest(mLinearLayout);
    }