use of com.kickstarter.models.Update in project android-oss by kickstarter.
the class ProjectUpdatesViewModelTest method testProjectUpdatesViewModel_StartCommentsActivity.
@Test
public void testProjectUpdatesViewModel_StartCommentsActivity() {
final ProjectUpdatesViewModel.ViewModel vm = new ProjectUpdatesViewModel.ViewModel(environment());
final Project project = ProjectFactory.project();
final Request commentsRequest = new Request.Builder().url("https://kck.str/projects/param/param/posts/id/comments").build();
final TestSubscriber<Update> startCommentsActivity = new TestSubscriber<>();
vm.outputs.startCommentsActivity().subscribe(startCommentsActivity);
vm.intent(new Intent().putExtra(IntentKey.PROJECT, project));
vm.inputs.goToCommentsRequest(commentsRequest);
startCommentsActivity.assertValueCount(1);
}
use of com.kickstarter.models.Update in project android-oss by kickstarter.
the class UpdateViewModelTest method testUpdateViewModel_StartShareIntent.
@Test
public void testUpdateViewModel_StartShareIntent() {
final UpdateViewModel.ViewModel vm = new UpdateViewModel.ViewModel(environment());
final Update update = UpdateFactory.update();
final TestSubscriber<Update> startShareIntent = new TestSubscriber<>();
vm.outputs.startShareIntent().subscribe(startShareIntent);
// Start the intent with a project and update.
vm.intent(new Intent().putExtra(IntentKey.PROJECT, ProjectFactory.project()).putExtra(IntentKey.UPDATE, update));
vm.inputs.shareIconButtonClicked();
startShareIntent.assertValues(update);
}
Aggregations