DueDateView extends RelativeLayout { public void select(boolean isSelected) { mBackground.setBackgroundColor(ContextCompat.getColor(getContext(), isSelected ? R.color.due_date_enable : R.color.due_date_disable)); } DueDateView(Context context, AttributeSet attrs);  DueDateView(Context context, AttributeSet attrs, int defStyleAttr); void select(boolean isSelected); Date getDate(); void setInitDate(Date date); void setPickDate(int year, int monthOfYear, int dayOfMonth); void setDayTitle(String title); void setSubtitle(String subtitle);  }
@Test public void testSelectTrue() throws Exception { mDueDateView.select(true); assertViewBackgroundColor(mBackground, R.color.due_date_enable); }
@Test public void testSelectFalse() throws Exception { mDueDateView.select(false); assertViewBackgroundColor(mBackground, R.color.due_date_disable); }