use of com.kickstarter.ui.adapters.data.ProjectDashboardData in project android-oss by kickstarter.
the class CreatorDashboardHeaderHolderViewModelTest method testOtherProjectsButtonIsGone_whenCurrentUserIsMemberOfManyProjects_viewingSingleProject.
@Test
public void testOtherProjectsButtonIsGone_whenCurrentUserIsMemberOfManyProjects_viewingSingleProject() {
final CurrentUserType collaborator = new MockCurrentUser(UserFactory.collaborator());
setUpEnvironment(environment().toBuilder().currentUser(collaborator).build());
this.vm.inputs.configureWith(new ProjectDashboardData(ProjectFactory.project(), ProjectStatsEnvelopeFactory.projectStatsEnvelope(), true));
this.otherProjectsButtonIsGone.assertValue(true);
}
use of com.kickstarter.ui.adapters.data.ProjectDashboardData in project android-oss by kickstarter.
the class CreatorDashboardHeaderHolderViewModelTest method testProjectNameTextViewText.
@Test
public void testProjectNameTextViewText() {
final Project project = ProjectFactory.project().toBuilder().name("somebody once told me").build();
final ProjectStatsEnvelope projectStatsEnvelope = ProjectStatsEnvelopeFactory.projectStatsEnvelope();
setUpEnvironment(environment());
this.vm.inputs.configureWith(new ProjectDashboardData(project, projectStatsEnvelope, false));
this.projectNameTextViewText.assertValue("somebody once told me");
}
use of com.kickstarter.ui.adapters.data.ProjectDashboardData in project android-oss by kickstarter.
the class CreatorDashboardHeaderHolderViewModelTest method testStartProjectActivity_whenFeatureFlagOn_shouldEmitProjectPage.
@Test
public void testStartProjectActivity_whenFeatureFlagOn_shouldEmitProjectPage() {
final Project project = ProjectFactory.project();
final ProjectStatsEnvelope projectStatsEnvelope = ProjectStatsEnvelopeFactory.projectStatsEnvelope();
final CurrentUserType currentUser = new MockCurrentUser();
final MockExperimentsClientType mockExperimentsClientType = new MockExperimentsClientType() {
@Override
public boolean isFeatureEnabled(@NotNull final OptimizelyFeature.Key feature) {
return true;
}
};
this.setUpEnvironment(environment().toBuilder().currentUser(currentUser).optimizely(mockExperimentsClientType).build());
this.vm.inputs.configureWith(new ProjectDashboardData(project, projectStatsEnvelope, false));
this.vm.inputs.projectButtonClicked();
this.startProjectActivity.assertValueCount(1);
assertEquals(this.startProjectActivity.getOnNextEvents().get(0).first, project);
assertEquals(this.startProjectActivity.getOnNextEvents().get(0).second, RefTag.dashboard());
}
use of com.kickstarter.ui.adapters.data.ProjectDashboardData in project android-oss by kickstarter.
the class CreatorDashboardHeaderHolderViewModelTest method testTimeRemainingText.
@Test
public void testTimeRemainingText() {
setUpEnvironment(environment());
DateTimeUtils.setCurrentMillisFixed(new DateTime().getMillis());
final Project project = ProjectFactory.project().toBuilder().deadline(new DateTime().plusDays(10)).build();
final ProjectStatsEnvelope projectStatsEnvelope = ProjectStatsEnvelopeFactory.projectStatsEnvelope();
final int deadlineVal = ProjectExt.deadlineCountdownValue(project);
this.vm.inputs.configureWith(new ProjectDashboardData(project, projectStatsEnvelope, false));
this.timeRemainingText.assertValue(NumberUtils.format(deadlineVal));
}
use of com.kickstarter.ui.adapters.data.ProjectDashboardData in project android-oss by kickstarter.
the class CreatorDashboardHeaderHolderViewModelTest method testViewProjectButtonIsGone_whenViewingSingleProject.
@Test
public void testViewProjectButtonIsGone_whenViewingSingleProject() {
setUpEnvironment(environment());
this.vm.inputs.configureWith(new ProjectDashboardData(ProjectFactory.project(), ProjectStatsEnvelopeFactory.projectStatsEnvelope(), true));
this.viewProjectButtonIsGone.assertValue(true);
}
Aggregations