use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class ConfigTests method testZeroRatingNoConfig.
@Test
public void testZeroRatingNoConfig() {
JsonObject configBase = new JsonObject();
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 LoginPresenterTest method testOnViewCreation_withGoogleFacebookEnabled_socialLoginButtonsVisible.
@Test
public void testOnViewCreation_withGoogleFacebookEnabled_socialLoginButtonsVisible() {
when(config.getGoogleConfig()).thenReturn(new Config.GoogleConfig(true));
when(config.getFacebookConfig()).thenReturn(new Config.FacebookConfig(false, "dummy app id"));
startPresenter(new LoginPresenter(config, zeroRatedNetworkInfo));
verify(view).setSocialLoginButtons(true, false);
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class LoginPresenterTest method testOnViewCreation_withGoogleLoginDisabled_googleButtonNotVisible.
@Test
public void testOnViewCreation_withGoogleLoginDisabled_googleButtonNotVisible() {
when(config.getGoogleConfig()).thenReturn(new Config.GoogleConfig(false));
when(config.getFacebookConfig()).thenReturn(new Config.FacebookConfig(false, "dummy app id"));
startPresenter(new LoginPresenter(config, zeroRatedNetworkInfo));
verify(view).setSocialLoginButtons(false, false);
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class LoginPresenterTest method testOnViewCreation_withZeroRatedNetwork_socialLoginButtonsNotVisible.
@Test
public void testOnViewCreation_withZeroRatedNetwork_socialLoginButtonsNotVisible() {
when(zeroRatedNetworkInfo.isOnZeroRatedNetwork()).thenReturn(true);
when(config.getGoogleConfig()).thenReturn(new Config.GoogleConfig(true));
when(config.getFacebookConfig()).thenReturn(new Config.FacebookConfig(true, "dummy app id"));
startPresenter(new LoginPresenter(config, zeroRatedNetworkInfo));
verify(view).setSocialLoginButtons(false, false);
}
use of org.edx.mobile.util.Config in project edx-app-android by edx.
the class LoginPresenterTest method testOnViewCreation_withFacebookLoginDisabled_facebookButtonNotVisible.
@Test
public void testOnViewCreation_withFacebookLoginDisabled_facebookButtonNotVisible() {
when(config.getGoogleConfig()).thenReturn(new Config.GoogleConfig(false));
when(config.getFacebookConfig()).thenReturn(new Config.FacebookConfig(true, "dummy app id"));
startPresenter(new LoginPresenter(config, zeroRatedNetworkInfo));
verify(view).setSocialLoginButtons(false, true);
}
Aggregations