Search in sources :

Example 1 with Faq

use of org.fossasia.openevent.app.data.models.Faq in project open-event-orga-app by fossasia.

the class FaqListPresenterTest method testProgressbarOnSwipeRefreshNoItem.

@Test
public void testProgressbarOnSwipeRefreshNoItem() {
    List<Faq> emptyList = new ArrayList<>();
    when(faqRepository.getFaqs(ID, true)).thenReturn(Observable.fromIterable(emptyList));
    faqListPresenter.loadFaqs(true);
    InOrder inOrder = Mockito.inOrder(faqListView);
    inOrder.verify(faqListView).showProgress(true);
    inOrder.verify(faqListView).onRefreshComplete(true);
    inOrder.verify(faqListView).showProgress(false);
}
Also used : InOrder(org.mockito.InOrder) Faq(org.fossasia.openevent.app.data.models.Faq) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 2 with Faq

use of org.fossasia.openevent.app.data.models.Faq in project open-event-orga-app by fossasia.

the class EventDelegate method getEventFaqs.

@Override
@JsonIgnore
public List<Faq> getEventFaqs() {
    List<Faq> faqs = event.getFaqs();
    if (faqs != null && !faqs.isEmpty()) {
        for (Faq faq : faqs) faq.setEvent(event);
        return faqs;
    }
    event.setFaqs(SQLite.select().from(Faq.class).where(Faq_Table.event_id.eq(event.getId())).queryList());
    return faqs;
}
Also used : Faq(org.fossasia.openevent.app.data.models.Faq) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

Faq (org.fossasia.openevent.app.data.models.Faq)2 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 InOrder (org.mockito.InOrder)1