Search in sources :

Example 6 with ProjectsEnvelope

use of com.kickstarter.services.apiresponses.ProjectsEnvelope in project android-oss by kickstarter.

the class CreatorDashboardViewModelTest method testProjectName_whenSingleProject.

@Test
public void testProjectName_whenSingleProject() {
    final Project project = ProjectFactory.project().toBuilder().name("Best Project 2K19").build();
    final MockApiClient apiClient = new MockApiClient() {

        @Override
        @NonNull
        public Observable<ProjectsEnvelope> fetchProjects(final boolean member) {
            return Observable.just(ProjectsEnvelopeFactory.projectsEnvelope(Collections.singletonList(project)));
        }
    };
    setUpEnvironment(environment().toBuilder().apiClient(apiClient).build());
    this.vm.intent(new Intent().putExtra(IntentKey.PROJECT, project));
    this.projectName.assertValue("Best Project 2K19");
}
Also used : Project(com.kickstarter.models.Project) ProjectsEnvelope(com.kickstarter.services.apiresponses.ProjectsEnvelope) MockApiClient(com.kickstarter.mock.services.MockApiClient) Intent(android.content.Intent) Test(org.junit.Test)

Aggregations

MockApiClient (com.kickstarter.mock.services.MockApiClient)6 Project (com.kickstarter.models.Project)6 ProjectsEnvelope (com.kickstarter.services.apiresponses.ProjectsEnvelope)6 Intent (android.content.Intent)5 Test (org.junit.Test)5 NonNull (androidx.annotation.NonNull)2 ProjectStatsEnvelope (com.kickstarter.services.apiresponses.ProjectStatsEnvelope)2 ProjectDashboardData (com.kickstarter.ui.adapters.data.ProjectDashboardData)2 DateTime (org.joda.time.DateTime)1