Search in sources :

Example 16 with ProjectStatsEnvelope

use of com.kickstarter.services.apiresponses.ProjectStatsEnvelope in project android-oss by kickstarter.

the class CreatorDashboardReferrerBreakdownHolderViewModelTest method testReferrerPercents.

@Test
public void testReferrerPercents() {
    final Project project = ProjectFactory.project();
    final ProjectStatsEnvelope.ReferralAggregateStats referralAggregateStats = ProjectStatsEnvelopeFactory.ReferralAggregateStatsFactory.referralAggregates().toBuilder().custom(100).internal(50).external(50).build();
    final ProjectStatsEnvelope.CumulativeStats cumulativeStats = ProjectStatsEnvelopeFactory.CumulativeStatsFactory.cumulativeStats().toBuilder().pledged(200).build();
    final ProjectStatsEnvelope projectStatsEnvelope = ProjectStatsEnvelopeFactory.projectStatsEnvelope().toBuilder().referralAggregates(referralAggregateStats).cumulative(cumulativeStats).build();
    setUpEnvironment(environment());
    this.vm.inputs.projectAndStatsInput(Pair.create(project, projectStatsEnvelope));
    this.customReferrerPercent.assertValues(.5f);
    this.externalReferrerPercent.assertValues(.25f);
    this.kickstarterReferrerPercent.assertValues(.25f);
}
Also used : Project(com.kickstarter.models.Project) ProjectStatsEnvelope(com.kickstarter.services.apiresponses.ProjectStatsEnvelope) Test(org.junit.Test)

Aggregations

Project (com.kickstarter.models.Project)16 ProjectStatsEnvelope (com.kickstarter.services.apiresponses.ProjectStatsEnvelope)16 ProjectDashboardData (com.kickstarter.ui.adapters.data.ProjectDashboardData)11 Test (org.junit.Test)10 NonNull (androidx.annotation.NonNull)5 Intent (android.content.Intent)3 MockApiClient (com.kickstarter.mock.services.MockApiClient)3 CurrentUserType (com.kickstarter.libs.CurrentUserType)2 MockCurrentUser (com.kickstarter.libs.MockCurrentUser)2 ProjectsEnvelope (com.kickstarter.services.apiresponses.ProjectsEnvelope)2 DateTime (org.joda.time.DateTime)2 MockExperimentsClientType (com.kickstarter.mock.MockExperimentsClientType)1 User (com.kickstarter.models.User)1 NotNull (org.jetbrains.annotations.NotNull)1