NetworkManager { public boolean isDataRoamingEnabled() { NetworkInfo info = getNetworkInfo(); return info != null && info.isRoaming(); } NetworkManager(Context context); static NetworkManager getInstance(Context context); boolean isOnline(); String getConnectedNetworkType(); boolean isDataRoamingEnabled(); int getNetworkIBType();  }
@Test public void isDataRoamingEnabledTest() { when(mNetworkInfo.isRoaming()).thenReturn(false); assertFalse(mNetManager.isDataRoamingEnabled()); when(mNetworkInfo.isRoaming()).thenReturn(true); assertTrue(mNetManager.isDataRoamingEnabled()); }