@Test public void testGetHeaderText() throws Exception { LocalDate date = LocalDate.now(); RangeUnit unit = mock(RangeUnit.class); when(unit.getType()).thenReturn(CalendarUnit.TYPE_WEEK); when(unit.getFrom()).thenReturn(date); when(unit.getTo()).thenReturn(date); when(formatter.getHeaderText(eq(CalendarUnit.TYPE_WEEK), eq(date), eq(date))).thenReturn("header"); mCalendarManager.setUnit(unit); String header = mCalendarManager.getHeaderText(); assertEquals("header", header); }
@NonNull public String getHeaderText() { return formatter.getHeaderText(mUnit.getType(), mUnit.getFrom(), mUnit.getTo()); }
CalendarManager { @NonNull public String getHeaderText() { return formatter.getHeaderText(mUnit.getType(), mUnit.getFrom(), mUnit.getTo()); } }
CalendarManager { @NonNull public String getHeaderText() { return formatter.getHeaderText(mUnit.getType(), mUnit.getFrom(), mUnit.getTo()); } CalendarManager(@NonNull LocalDate selected, @NonNull State state, @Nullable LocalDate minDate,
                           @Nullable LocalDate maxDate);  CalendarManager(@NonNull LocalDate selected, @NonNull State state, @Nullable LocalDate minDate,
            @Nullable LocalDate maxDate, @Nullable Formatter formatter); }
CalendarManager { @NonNull public String getHeaderText() { return formatter.getHeaderText(mUnit.getType(), mUnit.getFrom(), mUnit.getTo()); } CalendarManager(@NonNull LocalDate selected, @NonNull State state, @Nullable LocalDate minDate,
                           @Nullable LocalDate maxDate);  CalendarManager(@NonNull LocalDate selected, @NonNull State state, @Nullable LocalDate minDate,
            @Nullable LocalDate maxDate, @Nullable Formatter formatter); boolean selectDay(@NonNull LocalDate date); @NonNull LocalDate getSelectedDay(); @NonNull String getHeaderText(); boolean hasNext(); boolean hasPrev(); boolean next(); boolean prev(); void toggleView(); @NonNull State getState(); CalendarUnit getUnits(); LocalDate getActiveMonth(); int getWeekOfMonth(); void init(@NonNull LocalDate date, @Nullable LocalDate minDate, @Nullable LocalDate maxDate); @Nullable LocalDate getMinDate(); void setMinDate(@Nullable LocalDate minDate); @Nullable LocalDate getMaxDate(); void setMaxDate(@Nullable LocalDate maxDate); @NonNull Formatter getFormatter(); }
CalendarManager { @NonNull public String getHeaderText() { return formatter.getHeaderText(mUnit.getType(), mUnit.getFrom(), mUnit.getTo()); } CalendarManager(@NonNull LocalDate selected, @NonNull State state, @Nullable LocalDate minDate,
                           @Nullable LocalDate maxDate);  CalendarManager(@NonNull LocalDate selected, @NonNull State state, @Nullable LocalDate minDate,
            @Nullable LocalDate maxDate, @Nullable Formatter formatter); boolean selectDay(@NonNull LocalDate date); @NonNull LocalDate getSelectedDay(); @NonNull String getHeaderText(); boolean hasNext(); boolean hasPrev(); boolean next(); boolean prev(); void toggleView(); @NonNull State getState(); CalendarUnit getUnits(); LocalDate getActiveMonth(); int getWeekOfMonth(); void init(@NonNull LocalDate date, @Nullable LocalDate minDate, @Nullable LocalDate maxDate); @Nullable LocalDate getMinDate(); void setMinDate(@Nullable LocalDate minDate); @Nullable LocalDate getMaxDate(); void setMaxDate(@Nullable LocalDate maxDate); @NonNull Formatter getFormatter();  }