use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_deviceGroupsConditions.
@Test
public void toTargeting_deviceGroupsConditions() {
ModuleConditions moduleConditions = ModuleConditions.builder().setDeviceGroupsCondition(DeviceGroupsCondition.create(ImmutableSet.of("group1", "group2"))).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).ignoringRepeatedFieldOrder().isEqualTo(moduleDeviceGroupsTargeting("group1", "group2"));
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_exludeUserCountriesCondition.
@Test
public void toTargeting_exludeUserCountriesCondition() {
ModuleConditions moduleConditions = ModuleConditions.builder().setUserCountriesCondition(UserCountriesCondition.create(ImmutableList.of("PL", "US"), /* exclude= */
true)).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).ignoringRepeatedFieldOrder().isEqualTo(mergeModuleTargeting(moduleExcludeCountriesTargeting("PL", "US")));
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_minSdkVersion.
@Test
public void toTargeting_minSdkVersion() {
ModuleConditions moduleConditions = ModuleConditions.builder().setMinSdkVersion(26).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).isEqualTo(moduleMinSdkVersionTargeting(26));
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_deviceFeatureConditions.
@Test
public void toTargeting_deviceFeatureConditions() {
ModuleConditions moduleConditions = ModuleConditions.builder().addDeviceFeatureCondition(DeviceFeatureCondition.create("com.feature1")).addDeviceFeatureCondition(DeviceFeatureCondition.create("com.feature2")).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).ignoringRepeatedFieldOrder().isEqualTo(mergeModuleTargeting(moduleFeatureTargeting("com.feature1"), moduleFeatureTargeting("com.feature2")));
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_deviceFeatureVersionedConditions.
@Test
public void toTargeting_deviceFeatureVersionedConditions() {
ModuleConditions moduleConditions = ModuleConditions.builder().addDeviceFeatureCondition(DeviceFeatureCondition.create("com.feature1", Optional.of(12))).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).ignoringRepeatedFieldOrder().isEqualTo(mergeModuleTargeting(moduleFeatureTargeting("com.feature1", 12)));
}
Aggregations