Search in sources :

Example 1 with ErroredBacking

use of com.kickstarter.models.ErroredBacking in project android-oss by kickstarter.

the class ActivityFeedAdapterTest method loggedInWithErroredBackings.

@Test
public void loggedInWithErroredBackings() {
    final ErroredBacking erroredBacking = ErroredBackingFactory.Companion.erroredBacking();
    this.adapter.takeErroredBackings(Collections.singletonList(erroredBacking));
    this.adapter.showLoggedInEmptyState(true);
    final List<List<Object>> data = Arrays.asList(Collections.singletonList(true), Collections.emptyList(), Collections.singletonList(1), Collections.singletonList(erroredBacking), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    Assert.assertEquals(data, this.adapter.sections());
}
Also used : ErroredBacking(com.kickstarter.models.ErroredBacking) List(java.util.List) Test(org.junit.Test)

Example 2 with ErroredBacking

use of com.kickstarter.models.ErroredBacking in project android-oss by kickstarter.

the class ActivityFeedAdapterTest method loggedInWithActivitiesAndErroredBackingsAndSurveys.

@Test
public void loggedInWithActivitiesAndErroredBackingsAndSurveys() {
    final Activity activity0 = ActivityFactory.projectStateChangedPositiveActivity();
    final Activity activity1 = ActivityFactory.friendBackingActivity();
    final Activity activity2 = ActivityFactory.projectStateChangedActivity();
    final ErroredBacking erroredBacking = ErroredBackingFactory.Companion.erroredBacking();
    final SurveyResponse surveyResponse0 = SurveyResponseFactory.surveyResponse();
    final SurveyResponse surveyResponse1 = SurveyResponseFactory.surveyResponse();
    this.adapter.takeActivities(Arrays.asList(activity0, activity1, activity2));
    this.adapter.takeErroredBackings(Collections.singletonList(erroredBacking));
    this.adapter.takeSurveys(Arrays.asList(surveyResponse0, surveyResponse1));
    this.adapter.showLoggedInEmptyState(true);
    final List<List<Object>> data = Arrays.asList(Collections.singletonList(true), Collections.emptyList(), Collections.singletonList(1), Collections.singletonList(erroredBacking), Collections.singletonList(2), Arrays.asList(surveyResponse0, surveyResponse1), Arrays.asList(activity0, activity1, activity2));
    Assert.assertEquals(data, this.adapter.sections());
}
Also used : ErroredBacking(com.kickstarter.models.ErroredBacking) SurveyResponse(com.kickstarter.models.SurveyResponse) Activity(com.kickstarter.models.Activity) List(java.util.List) Test(org.junit.Test)

Example 3 with ErroredBacking

use of com.kickstarter.models.ErroredBacking in project android-oss by kickstarter.

the class ActivityFeedAdapterTest method loggedOutWithErroredBackings.

@Test
public void loggedOutWithErroredBackings() {
    final ErroredBacking erroredBacking = ErroredBackingFactory.Companion.erroredBacking();
    this.adapter.takeErroredBackings(Collections.singletonList(erroredBacking));
    this.adapter.showLoggedOutEmptyState(true);
    final List<List<Object>> data = Arrays.asList(Collections.emptyList(), Collections.singletonList(false), Collections.singletonList(1), Collections.singletonList(erroredBacking), Collections.emptyList(), Collections.emptyList(), Collections.emptyList());
    Assert.assertEquals(data, this.adapter.sections());
}
Also used : ErroredBacking(com.kickstarter.models.ErroredBacking) List(java.util.List) Test(org.junit.Test)

Aggregations

ErroredBacking (com.kickstarter.models.ErroredBacking)3 List (java.util.List)3 Test (org.junit.Test)3 Activity (com.kickstarter.models.Activity)1 SurveyResponse (com.kickstarter.models.SurveyResponse)1