use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testFacebookNoConfig.
@Test
public void testFacebookNoConfig() {
JsonObject configBase = new JsonObject();
Config config = new Config(configBase);
assertFalse(config.getFacebookConfig().isEnabled());
assertNull(config.getFacebookConfig().getFacebookAppId());
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testZeroRatingEmptyConfig.
@Test
public void testZeroRatingEmptyConfig() {
JsonObject configBase = new JsonObject();
JsonObject socialConfig = new JsonObject();
configBase.add(ZERO_RATING, socialConfig);
Config config = new Config(configBase);
assertFalse(config.getZeroRatingConfig().isEnabled());
assertEquals(config.getZeroRatingConfig().getCarriers().size(), 0);
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testEnrollmentEmptyConfig.
@Test
public void testEnrollmentEmptyConfig() {
JsonObject configBase = new JsonObject();
JsonObject enrollmentConfig = new JsonObject();
configBase.add(COURSE_ENROLLMENT, enrollmentConfig);
Config config = new Config(configBase);
assertFalse(config.getCourseDiscoveryConfig().isCourseDiscoveryEnabled());
assertFalse(config.getCourseDiscoveryConfig().isWebviewCourseDiscoveryEnabled());
assertNull(config.getCourseDiscoveryConfig().getCourseSearchUrl());
assertNull(config.getCourseDiscoveryConfig().getCourseInfoUrlTemplate());
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testEnrollmentConfig_withExploreSubjectsEnabled.
@Test
public void testEnrollmentConfig_withExploreSubjectsEnabled() {
JsonObject configBase = new JsonObject();
JsonObject enrollmentConfig = new JsonObject();
JsonObject webviewConfig = new JsonObject();
enrollmentConfig.add(TYPE, new JsonPrimitive("WEBVIEW"));
webviewConfig.add(COURSE_SEARCH_URL, new JsonPrimitive("fake-url"));
webviewConfig.add(EXPLORE_SUBJECTS_URL, new JsonPrimitive("explore-subjects-url"));
webviewConfig.add(COURSE_INFO_URL_TEMPLATE, new JsonPrimitive("fake-url-template"));
enrollmentConfig.add("WEBVIEW", webviewConfig);
configBase.add(COURSE_ENROLLMENT, enrollmentConfig);
Config config = new Config(configBase);
assertTrue(config.getCourseDiscoveryConfig().isCourseDiscoveryEnabled());
assertTrue(config.getCourseDiscoveryConfig().isWebviewCourseDiscoveryEnabled());
assertEquals(config.getCourseDiscoveryConfig().getCourseSearchUrl(), "fake-url");
assertEquals(config.getCourseDiscoveryConfig().getCourseInfoUrlTemplate(), "fake-url-template");
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testGoogleNoConfig.
@Test
public void testGoogleNoConfig() {
JsonObject configBase = new JsonObject();
Config config = new Config(configBase);
assertFalse(config.getGoogleConfig().isEnabled());
}
Aggregations