Search in sources :

Example 6 with SurveyResponse

use of com.kickstarter.models.SurveyResponse 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 7 with SurveyResponse

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

the class SurveyHolderViewModelTest method testSurveyDescription.

@Test
public void testSurveyDescription() {
    final SurveyResponse surveyResponse = SurveyResponseFactory.surveyResponse();
    setUpEnvironment(environment());
    this.vm.inputs.configureWith(surveyResponse);
    this.projectForSurveyDescription.assertValues(surveyResponse.project());
}
Also used : SurveyResponse(com.kickstarter.models.SurveyResponse) Test(org.junit.Test)

Example 8 with SurveyResponse

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

the class SurveyHolderViewModelTest method testStartSurveyResponseActivity.

@Test
public void testStartSurveyResponseActivity() {
    final SurveyResponse surveyResponse = SurveyResponseFactory.surveyResponse();
    setUpEnvironment(environment());
    this.vm.inputs.configureWith(surveyResponse);
    this.vm.inputs.surveyClicked();
    this.startSurveyResponseActivity.assertValue(surveyResponse);
}
Also used : SurveyResponse(com.kickstarter.models.SurveyResponse) Test(org.junit.Test)

Example 9 with SurveyResponse

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

the class SurveyHolderViewModelTest method testCreatorAvatarImageUrl.

@Test
public void testCreatorAvatarImageUrl() {
    final SurveyResponse surveyResponse = SurveyResponseFactory.surveyResponse();
    setUpEnvironment(environment());
    this.vm.inputs.configureWith(surveyResponse);
    this.creatorAvatarImageUrl.assertValues(surveyResponse.project().creator().avatar().small());
}
Also used : SurveyResponse(com.kickstarter.models.SurveyResponse) Test(org.junit.Test)

Aggregations

SurveyResponse (com.kickstarter.models.SurveyResponse)9 Test (org.junit.Test)9 Intent (android.content.Intent)3 List (java.util.List)2 Request (okhttp3.Request)2 CurrentUserType (com.kickstarter.libs.CurrentUserType)1 Environment (com.kickstarter.libs.Environment)1 MockCurrentUser (com.kickstarter.libs.MockCurrentUser)1 MockApiClient (com.kickstarter.mock.services.MockApiClient)1 Activity (com.kickstarter.models.Activity)1 ErroredBacking (com.kickstarter.models.ErroredBacking)1