use of android.net.NetworkScoreManager in project robolectric by robolectric.
the class ShadowNetworkScoreManagerTest method testGetActiveScorerPackage.
@Test
@Config(minSdk = LOLLIPOP)
public void testGetActiveScorerPackage() {
Context context = ApplicationProvider.getApplicationContext();
NetworkScoreManager networkScoreManager = (NetworkScoreManager) context.getSystemService(Context.NETWORK_SCORE_SERVICE);
String testPackage = "com.package.test";
networkScoreManager.setActiveScorer(testPackage);
assertThat(networkScoreManager.getActiveScorerPackage()).isEqualTo(testPackage);
}
use of android.net.NetworkScoreManager in project robolectric by robolectric.
the class ShadowNetworkScoreManagerTest method testIsScoringEnabled.
@Test
@Config(minSdk = LOLLIPOP)
public void testIsScoringEnabled() {
Context context = ApplicationProvider.getApplicationContext();
NetworkScoreManager networkScoreManager = (NetworkScoreManager) context.getSystemService(Context.NETWORK_SCORE_SERVICE);
networkScoreManager.disableScoring();
ShadowNetworkScoreManager m = Shadow.extract(networkScoreManager);
assertThat(m.isScoringEnabled()).isFalse();
}
Aggregations