use of com.kickstarter.ui.adapters.data.CommentsData in project android-oss by kickstarter.
the class CommentsViewModelTest method testCommentsViewModel_EmptyState.
@Test
public void testCommentsViewModel_EmptyState() {
final ApiClientType apiClient = new MockApiClient() {
@Override
@NonNull
public Observable<CommentsEnvelope> fetchComments(@NonNull final Update update) {
return Observable.empty();
}
};
final Environment env = environment().toBuilder().apiClient(apiClient).build();
final CommentsViewModel vm = new CommentsViewModel(env);
final TestSubscriber<CommentsData> commentsData = new TestSubscriber<>();
vm.outputs.commentsData().subscribe(commentsData);
// Start the view model with an update.
vm.intent(new Intent().putExtra(IntentKey.UPDATE, UpdateFactory.update()));
// Only Viewed Comments event should fire.
koalaTest.assertValues(KoalaEvent.VIEWED_COMMENTS);
commentsData.assertNoValues();
}
Aggregations