DueDatePicker extends RelativeLayout { public Observable<Date> date() { return mDueDate.asObservable(); } DueDatePicker(Context context);  DueDatePicker(Context context, AttributeSet attrs);  DueDatePicker(Context context, AttributeSet attrs, int defStyleAttr); void setListenerPickDate(ListenerPickDate listenerPickDate); void setDueDate(Date dueDate); Observable<Date> date();  }
@Test public void testDefaultDate() throws Exception { mDueDatePicker.date().subscribe(date -> { assertTrue(DateUtils.isToday(date)); }); }
@Test public void testClickNoDueDate() throws Exception { mNoDateView.performClick(); mDueDatePicker.date().subscribe(Assert::assertNull); assertDueDateSelected(mNoDateView); }
@Test public void testClickDueDateTomorrow() throws Exception { mTomorrowView.performClick(); mDueDatePicker.date().subscribe(date -> { assertTrue(DateUtils.isTomorrow(date)); }); assertDueDateSelected(mTomorrowView); }
@Test public void testClickDueDate() throws Exception { mDayPicker.performClick(); mDueDatePicker.date().subscribe(date -> { assertEquals("14/02/2016", DateUtils.formatDate(date)); }); assertDueDateSelected(mDayPicker); }