MediaBadgeView extends FrameLayout { public void setCard(Card card) { if (VineCardUtils.isVine(card)) { setBadge(getResources().getDrawable(R.drawable.tw__vine_badge)); } else { setEmpty(); } } MediaBadgeView(Context context);  MediaBadgeView(Context context, AttributeSet attrs);  MediaBadgeView(Context context, AttributeSet attrs, int defStyleAttr); void setMediaEntity(MediaEntity entity); void setCard(Card card);  }
@Test public void testSetEntity_withVineCard() { final Card vineCard = TestFixtures.sampleValidVineCard(); view.setCard(vineCard); assertEquals(View.VISIBLE, view.badge.getVisibility()); assertEquals(View.GONE, view.videoDuration.getVisibility()); }
@Test public void testSetEntity_withInvalidVineCard() { final Card vineCard = TestFixtures.sampleInvalidVineCard(); view.setCard(vineCard); assertEquals(View.GONE, view.badge.getVisibility()); assertEquals(View.GONE, view.videoDuration.getVisibility()); }