use of com.kickstarter.services.apiresponses.DiscoverEnvelope in project android-oss by kickstarter.
the class ProfileViewModelTest method testProfileViewModel_EmitsProjects.
@Test
public void testProfileViewModel_EmitsProjects() {
final ApiClientType apiClient = new MockApiClient() {
@Override
@NonNull
public Observable<DiscoverEnvelope> fetchProjects(@NonNull final DiscoveryParams params) {
return Observable.just(DiscoverEnvelopeFactory.discoverEnvelope(Collections.singletonList(ProjectFactory.project())));
}
};
final Environment env = environment().toBuilder().apiClient(apiClient).build();
final ProfileViewModel.ViewModel vm = new ProfileViewModel.ViewModel(env);
final TestSubscriber<List<Project>> projects = new TestSubscriber<>();
vm.outputs.projects().subscribe(projects);
koalaTest.assertValues(KoalaEvent.PROFILE_VIEW_MY, KoalaEvent.VIEWED_PROFILE);
projects.assertValueCount(1);
}
Aggregations