@Test
public void should_return_is_not_online_when_network_is_not_available() throws Exception {

    NetworkInfo networkInfo = mock(NetworkInfo.class);
    when(networkInfo.isAvailable()).thenReturn(false);
    when(connectivityManager.getActiveNetworkInfo()).thenReturn(networkInfo);
    assertThat("Should return false", loginService.isOnline(), is(false));
}