Search in sources :

Example 1 with ICallingController

use of com.waz.zclient.controllers.calling.ICallingController in project wire-android by wireapp.

the class ConversationFragmentTest method assertAudioCallInitatedInOneToOneConversation.

@Test
public void assertAudioCallInitatedInOneToOneConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.ONE_TO_ONE);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    ICallingController mockCallingController = activity.getControllerFactory().getCallingController();
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.action_audio_call)).check(isVisible());
    onView(withId(R.id.action_audio_call)).perform(click());
    verify(mockCallingController).startCall(false);
}
Also used : IConversation(com.waz.api.IConversation) ICallingController(com.waz.zclient.controllers.calling.ICallingController) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 2 with ICallingController

use of com.waz.zclient.controllers.calling.ICallingController in project wire-android by wireapp.

the class ConversationFragmentTest method assertVideoCallInitatedInOneToOneConversation.

@Test
public void assertVideoCallInitatedInOneToOneConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.ONE_TO_ONE);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    ICallingController mockCallingController = activity.getControllerFactory().getCallingController();
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.action_video_call)).check(isVisible());
    onView(withId(R.id.action_video_call)).perform(click());
    verify(mockCallingController).startCall(true);
}
Also used : IConversation(com.waz.api.IConversation) ICallingController(com.waz.zclient.controllers.calling.ICallingController) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 3 with ICallingController

use of com.waz.zclient.controllers.calling.ICallingController in project wire-android by wireapp.

the class ConversationFragmentTest method assertAudioCallInitatedInGroupConversation.

@Test
public void assertAudioCallInitatedInGroupConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    ICallingController mockCallingController = activity.getControllerFactory().getCallingController();
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.action_audio_call)).check(isVisible());
    onView(withId(R.id.action_audio_call)).perform(click());
    verify(mockCallingController).startCall(false);
}
Also used : IConversation(com.waz.api.IConversation) ICallingController(com.waz.zclient.controllers.calling.ICallingController) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Aggregations

IConversation (com.waz.api.IConversation)3 ICallingController (com.waz.zclient.controllers.calling.ICallingController)3 FragmentTest (com.waz.zclient.testutils.FragmentTest)3 Test (org.junit.Test)3