use of com.kickstarter.libs.utils.ExperimentData in project android-oss by kickstarter.
the class DiscoveryFragmentViewModelTest method testShouldShowEditorial_featureDisabled.
@Test
public void testShouldShowEditorial_featureDisabled() {
final MockCurrentUser user = new MockCurrentUser();
final MockExperimentsClientType mockExperimentsClientType = new MockExperimentsClientType() {
@Override
public boolean isFeatureEnabled(@NotNull final OptimizelyFeature.Key feature, @NotNull final ExperimentData experimentData) {
return false;
}
};
final Environment environment = environment().toBuilder().currentUser(user).optimizely(mockExperimentsClientType).build();
setUpEnvironment(environment);
setUpInitialHomeAllProjectsParams();
this.shouldShowEditorial.assertValue(null);
}
use of com.kickstarter.libs.utils.ExperimentData in project android-oss by kickstarter.
the class DiscoveryFragmentViewModelTest method testShouldShowEditorial_featureEnabled.
@Test
public void testShouldShowEditorial_featureEnabled() {
final MockCurrentUser user = new MockCurrentUser();
final MockExperimentsClientType mockExperimentsClientType = new MockExperimentsClientType() {
@Override
public boolean isFeatureEnabled(@NotNull final OptimizelyFeature.Key feature, @NotNull final ExperimentData experimentData) {
return true;
}
};
final Environment environment = environment().toBuilder().currentUser(user).optimizely(mockExperimentsClientType).build();
setUpEnvironment(environment);
setUpInitialHomeAllProjectsParams();
this.shouldShowEditorial.assertValue(Editorial.LIGHTS_ON);
}
use of com.kickstarter.libs.utils.ExperimentData in project android-oss by kickstarter.
the class DiscoveryFragmentViewModelTest method testShouldShowEditorial_whenOptimizelyInitializationDelay.
@Test
public void testShouldShowEditorial_whenOptimizelyInitializationDelay() {
final Environment environment = environment().toBuilder().currentUser(new MockCurrentUser()).optimizely(new MockExperimentsClientType() {
int enabledCount;
@Override
public boolean isFeatureEnabled(@NonNull final OptimizelyFeature.Key feature, @NonNull final ExperimentData experimentData) {
if (enabledCount == 0) {
enabledCount += 1;
return false;
} else {
return true;
}
}
}).build();
setUpEnvironment(environment);
setUpInitialHomeAllProjectsParams();
this.shouldShowEditorial.assertValue(null);
this.vm.optimizelyReady();
this.shouldShowEditorial.assertValues(null, Editorial.LIGHTS_ON);
}
Aggregations