@Test public void testItDrawsMultipleEventDaysOnCalendar() { // Sun, 07 Jun 2015 18:20:51 GMT // get 60 events in total List<Events> events = getDayEventWith2EventsPerDay(0, 30, 1433701251000L); when(eventsContainer.getEventsForMonthAndYear(5, 2015)).thenReturn(events); when(calendar.get(Calendar.MONTH)).thenReturn(5); when(calendar.get(Calendar.YEAR)).thenReturn(2015); underTest.setGrowProgress( 1000); // set grow progress so that it simulates the calendar being open underTest.drawEvents(canvas, calendar, 0); // draw events 58 times because we don't draw events for the current selected day since it wil // be highlighted with another indicator verify(canvas, times(58)).drawCircle(anyFloat(), anyFloat(), anyFloat(), eq(paint)); }
@Test public void testItDrawsMultipleEventDaysOnCalendarWithPlusIndicator() { // Sun, 07 Jun 2015 18:20:51 GMT // get 120 events in total but only draw 3 event indicators per a day List<Events> events = getDayEventWithMultipleEventsPerDay(0, 30, 1433701251000L); when(eventsContainer.getEventsForMonthAndYear(5, 2015)).thenReturn(events); when(calendar.get(Calendar.MONTH)).thenReturn(5); when(calendar.get(Calendar.YEAR)).thenReturn(2015); underTest.setGrowProgress( 1000); // set grow progress so that it simulates the calendar being open underTest.drawEvents(canvas, calendar, 0); // draw events 58 times because we don't draw more than 3 indicators verify(canvas, times(58)).drawCircle(anyFloat(), anyFloat(), anyFloat(), eq(paint)); // draw event indicator with lines // 2 calls for each plus event indicator since it takes 2 draw calls to make a plus sign verify(canvas, times(58)).drawLine(anyFloat(), anyFloat(), anyFloat(), anyFloat(), eq(paint)); }