Search in sources :

Example 1 with RegistrationCallback

use of android.telephony.ims.ImsMmTelManager.RegistrationCallback in project robolectric by robolectric.

the class ShadowImsMmTelManagerTest method registerImsRegistrationCallback_imsRegistering_onRegisteringInvoked.

@Test
public void registerImsRegistrationCallback_imsRegistering_onRegisteringInvoked() throws ImsException {
    RegistrationCallback registrationCallback = mock(RegistrationCallback.class);
    shadowImsMmTelManager.registerImsRegistrationCallback(Runnable::run, registrationCallback);
    shadowImsMmTelManager.setImsRegistering(ImsRegistrationImplBase.REGISTRATION_TECH_LTE);
    verify(registrationCallback).onRegistering(ImsRegistrationImplBase.REGISTRATION_TECH_LTE);
    shadowImsMmTelManager.unregisterImsRegistrationCallback(registrationCallback);
    shadowImsMmTelManager.setImsRegistering(ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN);
    verifyNoMoreInteractions(registrationCallback);
}
Also used : RegistrationCallback(android.telephony.ims.ImsMmTelManager.RegistrationCallback) Test(org.junit.Test)

Example 2 with RegistrationCallback

use of android.telephony.ims.ImsMmTelManager.RegistrationCallback in project robolectric by robolectric.

the class ShadowImsMmTelManagerTest method registerImsRegistrationCallback_imsRegistered_onRegisteredInvoked.

@Test
public void registerImsRegistrationCallback_imsRegistered_onRegisteredInvoked() throws ImsException {
    RegistrationCallback registrationCallback = mock(RegistrationCallback.class);
    shadowImsMmTelManager.registerImsRegistrationCallback(Runnable::run, registrationCallback);
    shadowImsMmTelManager.setImsRegistered(ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN);
    verify(registrationCallback).onRegistered(ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN);
    shadowImsMmTelManager.unregisterImsRegistrationCallback(registrationCallback);
    shadowImsMmTelManager.setImsRegistered(ImsRegistrationImplBase.REGISTRATION_TECH_LTE);
    verifyNoMoreInteractions(registrationCallback);
}
Also used : RegistrationCallback(android.telephony.ims.ImsMmTelManager.RegistrationCallback) Test(org.junit.Test)

Example 3 with RegistrationCallback

use of android.telephony.ims.ImsMmTelManager.RegistrationCallback in project robolectric by robolectric.

the class ShadowImsMmTelManagerTest method registerImsRegistrationCallback_imsUnregistered_onUnregisteredInvoked.

@Test
public void registerImsRegistrationCallback_imsUnregistered_onUnregisteredInvoked() throws ImsException {
    RegistrationCallback registrationCallback = mock(RegistrationCallback.class);
    shadowImsMmTelManager.registerImsRegistrationCallback(Runnable::run, registrationCallback);
    ImsReasonInfo imsReasonInfoWithCallbackRegistered = new ImsReasonInfo();
    shadowImsMmTelManager.setImsUnregistered(imsReasonInfoWithCallbackRegistered);
    verify(registrationCallback).onUnregistered(imsReasonInfoWithCallbackRegistered);
    ImsReasonInfo imsReasonInfoAfterUnregisteringCallback = new ImsReasonInfo();
    shadowImsMmTelManager.unregisterImsRegistrationCallback(registrationCallback);
    shadowImsMmTelManager.setImsUnregistered(imsReasonInfoAfterUnregisteringCallback);
    verifyNoMoreInteractions(registrationCallback);
}
Also used : RegistrationCallback(android.telephony.ims.ImsMmTelManager.RegistrationCallback) ImsReasonInfo(android.telephony.ims.ImsReasonInfo) Test(org.junit.Test)

Aggregations

RegistrationCallback (android.telephony.ims.ImsMmTelManager.RegistrationCallback)3 Test (org.junit.Test)3 ImsReasonInfo (android.telephony.ims.ImsReasonInfo)1