Code example for TextView

Methods: getCompoundDrawablessetCompoundDrawablesWithIntrinsicBounds

0
    assertEquals(R.drawable.fourth_image, shadowOf(textView.getCompoundDrawables()[3]).getCreatedFromResId());
  } 
 
  @Test 
  public void testSetCompountDrawablesWithIntrinsicBounds_int_shouldNotCreateDrawablesForZero() throws Exception { 
    textView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
 
    assertNull(textView.getCompoundDrawables()[0]);
    assertNull(textView.getCompoundDrawables()[1]);
    assertNull(textView.getCompoundDrawables()[2]);
    assertNull(textView.getCompoundDrawables()[3]);
  } 
 
  @Test 
  public void canSetAndGetTypeface() throws Exception { 
    Typeface typeface = Robolectric.newInstanceOf(Typeface.class);
    textView.setTypeface(typeface);
    assertSame(typeface, textView.getTypeface());
  } 
 
  @Test