use of com.kickstarter.ui.adapters.data.ProjectDashboardData in project android-oss by kickstarter.
the class CreatorDashboardHeaderHolderViewModelTest method testStartProjectActivity.
@Test
public void testStartProjectActivity() {
final Project project = ProjectFactory.project();
final ProjectStatsEnvelope projectStatsEnvelope = ProjectStatsEnvelopeFactory.projectStatsEnvelope();
setUpEnvironment(environment());
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 testOtherProjectsButtonIsGone_whenCurrentUserIsMemberOf1Project.
@Test
public void testOtherProjectsButtonIsGone_whenCurrentUserIsMemberOf1Project() {
final User collaboratorWith1Project = UserFactory.collaborator().toBuilder().memberProjectsCount(1).build();
final CurrentUserType collaborator = new MockCurrentUser(collaboratorWith1Project);
setUpEnvironment(environment().toBuilder().currentUser(collaborator).build());
this.vm.inputs.configureWith(new ProjectDashboardData(ProjectFactory.project(), ProjectStatsEnvelopeFactory.projectStatsEnvelope(), false));
this.otherProjectsButtonIsGone.assertValue(true);
}
use of com.kickstarter.ui.adapters.data.ProjectDashboardData in project android-oss by kickstarter.
the class CreatorDashboardHeaderHolderViewModelTest method testMessagesButtonIsGone_whenCurrentUserIsCollaborator.
@Test
public void testMessagesButtonIsGone_whenCurrentUserIsCollaborator() {
final User creator = UserFactory.creator();
final CurrentUserType currentUser = new MockCurrentUser(UserFactory.collaborator());
final Project project = ProjectFactory.project().toBuilder().creator(creator).build();
final ProjectStatsEnvelope projectStatsEnvelope = ProjectStatsEnvelopeFactory.projectStatsEnvelope();
setUpEnvironment(environment().toBuilder().currentUser(currentUser).build());
this.vm.inputs.configureWith(new ProjectDashboardData(project, projectStatsEnvelope, false));
// Messages button is gone if current user is not the project creator (e.g. a collaborator).
this.messagesButtonIsGone.assertValue(true);
}
Aggregations