use of com.kickstarter.mock.services.MockApolloClient in project android-oss by kickstarter.
the class DiscoveryFragmentViewModelTest method testShouldShowEmptySavedView_isFalse_whenUserHasSavedProjects.
@Test
public void testShouldShowEmptySavedView_isFalse_whenUserHasSavedProjects() {
final CurrentUserType currentUser = new MockCurrentUser();
final Environment environment = environment().toBuilder().apolloClient(new MockApolloClient()).currentUser(currentUser).build();
setUpEnvironment(environment);
// Initial home all projects params.
setUpInitialHomeAllProjectsParams();
this.hasProjects.assertValue(true);
this.shouldShowEmptySavedView.assertValue(false);
// Login.
logUserIn(currentUser);
// New projects load.
this.hasProjects.assertValues(true, true, true, true);
this.shouldShowEmptySavedView.assertValues(false);
// Saved projects params.
this.vm.inputs.paramsFromActivity(DiscoveryParams.builder().starred(1).build());
// New projects load with updated params.
this.hasProjects.assertValues(true, true, true, true, true, true);
this.shouldShowEmptySavedView.assertValues(false);
}
use of com.kickstarter.mock.services.MockApolloClient in project android-oss by kickstarter.
the class DiscoveryIntentMapperTest method emitsFromDiscoveryUri.
@Test
public void emitsFromDiscoveryUri() {
final Uri uri = Uri.parse("https://www.kickstarter.com/discover");
final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
final TestSubscriber<DiscoveryParams> resultTest = TestSubscriber.create();
DiscoveryIntentMapper.params(intent, new MockApiClient(), new MockApolloClient()).subscribe(resultTest);
resultTest.assertValues(DiscoveryParams.builder().build());
}
Aggregations