use of com.kickstarter.mock.services.MockApiClient in project android-oss by kickstarter.
the class ProjectUpdatesViewModelTest method testProjectAndUpdates.
@Test
public void testProjectAndUpdates() {
final List<Update> updates = Arrays.asList(UpdateFactory.update(), UpdateFactory.update());
final Project project = ProjectFactory.project();
setUpEnvironment(environment().toBuilder().apiClient(new MockApiClient() {
@NonNull
@Override
public Observable<UpdatesEnvelope> fetchUpdates(@NonNull final Project project) {
return Observable.just(UpdatesEnvelope.builder().updates(updates).urls(urlsEnvelope()).build());
}
}).build(), project, ProjectDataFactory.Companion.project(project));
this.projectAndUpdates.assertValues(Pair.create(project, updates));
}
Aggregations