use of org.robolectric.shadows.ShadowConnectivityManager in project OneSignal-Android-SDK by OneSignal.
the class MainOneSignalClassRunner method testOfflineCrashes.
@Test
public void testOfflineCrashes() throws Exception {
ConnectivityManager connectivityManager = (ConnectivityManager) RuntimeEnvironment.application.getSystemService(Context.CONNECTIVITY_SERVICE);
ShadowConnectivityManager shadowConnectivityManager = shadowOf(connectivityManager);
shadowConnectivityManager.setActiveNetworkInfo(null);
OneSignalInit();
threadAndTaskWait();
OneSignal.sendTag("key", "value");
threadAndTaskWait();
OneSignal.setSubscription(false);
threadAndTaskWait();
}
Aggregations