use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testFacebookEmptyConfig.
@Test
public void testFacebookEmptyConfig() {
JsonObject fbConfig = new JsonObject();
JsonObject configBase = new JsonObject();
configBase.add(FACEBOOK, fbConfig);
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 testEnrollmentInvalidType.
@Test(expected = IllegalArgumentException.class)
public void testEnrollmentInvalidType() {
JsonObject configBase = new JsonObject();
JsonObject enrollmentConfig = new JsonObject();
enrollmentConfig.add(TYPE, new JsonPrimitive("invalid type"));
configBase.add(COURSE_ENROLLMENT, enrollmentConfig);
Config config = new Config(configBase);
assertFalse(config.getCourseDiscoveryConfig().isCourseDiscoveryEnabled());
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testFabricKitsConfig.
@Test
public void testFabricKitsConfig() {
JsonObject fabricKits = new JsonObject();
fabricKits.add(CRASHLYTICS, new JsonPrimitive(true));
fabricKits.add(ANSWERS, new JsonPrimitive(true));
JsonObject fabricConfig = new JsonObject();
fabricConfig.add(KITS, fabricKits);
JsonObject configBase = new JsonObject();
configBase.add(FABRIC, fabricConfig);
Config config = new Config(configBase);
assertTrue(config.getFabricConfig().getKitsConfig().isAnswersEnabled());
assertTrue(config.getFabricConfig().getKitsConfig().isCrashlyticsEnabled());
assertTrue(config.getFabricConfig().getKitsConfig().hasEnabledKits());
assertEquals(2, config.getFabricConfig().getKitsConfig().getEnabledKits().length);
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testGoogleConfig.
@Test
public void testGoogleConfig() {
JsonObject googleConfig = new JsonObject();
googleConfig.add(ENABLED, new JsonPrimitive(true));
JsonObject configBase = new JsonObject();
configBase.add(GOOGLE, googleConfig);
Config config = new Config(configBase);
assertTrue(config.getGoogleConfig().isEnabled());
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testNewRelicEmptyConfig.
@Test
public void testNewRelicEmptyConfig() {
JsonObject fabricConfig = new JsonObject();
JsonObject configBase = new JsonObject();
configBase.add(NEW_RELIC, fabricConfig);
Config config = new Config(configBase);
assertFalse(config.getNewRelicConfig().isEnabled());
assertNull(config.getNewRelicConfig().getNewRelicKey());
}
Aggregations