use of org.fossasia.openevent.app.data.models.Event in project open-event-orga-app by fossasia.
the class EventDashboardPresenterTest method shouldHideProgressbarOnToggleError.
@Test
public void shouldHideProgressbarOnToggleError() {
when(eventRepository.updateEvent(any(Event.class))).thenReturn(Observable.error(Logger.TEST_ERROR));
eventDashboardPresenter.setEvent(EVENT);
eventDashboardPresenter.toggleState();
InOrder inOrder = Mockito.inOrder(eventDetailView, eventRepository);
inOrder.verify(eventRepository).updateEvent(any(Event.class));
inOrder.verify(eventDetailView).showProgress(true);
inOrder.verify(eventDetailView).showResult(any(Event.class));
inOrder.verify(eventDetailView).showProgress(false);
}
use of org.fossasia.openevent.app.data.models.Event in project open-event-orga-app by fossasia.
the class EventsPresenterTest method shouldShowEmptyViewOnNoItemAfterSwipeRefresh.
@Test
public void shouldShowEmptyViewOnNoItemAfterSwipeRefresh() {
ArrayList<Event> events = new ArrayList<>();
when(eventRepository.getEvents(true)).thenReturn(Observable.fromIterable(events));
InOrder inOrder = Mockito.inOrder(eventListView);
eventsActivityPresenter.loadUserEvents(true);
inOrder.verify(eventListView).showEmptyView(false);
inOrder.verify(eventListView).showResults(events);
inOrder.verify(eventListView).showEmptyView(true);
}
use of org.fossasia.openevent.app.data.models.Event in project open-event-orga-app by fossasia.
the class FragmentInstanceTest method setUpMockEvent.
private void setUpMockEvent() {
Event event = new Event();
event.timezone = "UTC";
event.endsAt = new ObservableString("2018-12-14T23:59:59.123456+00:00");
ContextManager.setSelectedEvent(event);
}
use of org.fossasia.openevent.app.data.models.Event in project open-event-orga-app by fossasia.
the class DateServiceTest method testClashLive.
@Test
public void testClashLive() {
Event liveLatest = new Event();
String nowMinus5 = DateUtils.formatDateToIso(LocalDateTime.now().minusDays(5));
String nowPlus5 = DateUtils.formatDateToIso(LocalDateTime.now().plusDays(5));
liveLatest.setStartsAt(new ObservableString(nowMinus5));
liveLatest.setEndsAt(new ObservableString(nowPlus5));
assertEquals(1, DateService.compareEventDates(LIVE, liveLatest));
}
Aggregations