@Test public void shouldDisconnectXMPPOnDestroy() { startService(); xmppService.onDestroy(); assertFalse(xmppConnection.isConnected()); }
@Test public void shouldUnregisterInterestInNetworkChangesOnDestroy() { startService(); xmppService.onDestroy(); List<ShadowApplication.Wrapper> wrappers = Robolectric.getShadowApplication().getRegisteredReceivers(); Assert.assertEquals(0, wrappers.size()); }