TodoItemViewModel extends BaseObservable implements Serializable { public String getDueDate() { return mTodo.getDueDate() == null ? NO_DUE_DATE : DateFormat.format("dd/MM/yyyy", mTodo.getDueDate()).toString(); } TodoItemViewModel(Todo todo); Todo getTodo(); ObservableInt getActionVisibility(); ObservableInt getDisableVisibility(); ObservableBoolean getEnableState(); ObservableInt getDividerVisibility(); void setTodo(Todo todo); void resetState(); void switchEnableWhenNotChoose(); void switchActionVisibility(); boolean isCompleted(); boolean actionShowing(); float getOpacity(); String getTitle(); String getDueDate(); Priority getPriority();  }
@Test public void testGetDueDate() throws Exception { Date date = new Date(1454994901327L); when(mTodo.getDueDate()).thenReturn(date); assertEquals("09/02/2016", mViewModel.getDueDate()); }
@Test public void testNoDueDate() throws Exception { when(mTodo.getDueDate()).thenReturn(null); assertEquals("No due date", mViewModel.getDueDate()); }