public void test_unbindService_removes_BroadcastReceiver() { wrapper.bindService(); ArgumentCaptor<BroadcastReceiver> broadcastReceiverArgumentCaptor = ArgumentCaptor.forClass(BroadcastReceiver.class); verify(context) .registerReceiver(broadcastReceiverArgumentCaptor.capture(), any(IntentFilter.class)); BroadcastReceiver broadcastReceiver = broadcastReceiverArgumentCaptor.getValue(); wrapper.unbindService(); verify(context).unregisterReceiver(broadcastReceiver); }
public void test_unbindService() throws RemoteException { wrapper.unbindService(); Mockito.verify(context).unbindService(Mockito.same(wrapper)); }