use of com.waz.zclient.core.stores.inappnotification.IInAppNotificationStore in project wire-android by wireapp.
the class FileUploadTest method assertFileTooBigWarningShowed.
@Test
@SuppressLint("NewApi")
public void assertFileTooBigWarningShowed() throws InterruptedException {
final ErrorsList.ErrorDescription mockErrorDescription = mock(ErrorsList.ErrorDescription.class);
when(mockErrorDescription.getType()).thenReturn(ErrorType.CANNOT_SEND_ASSET_TOO_LARGE);
IInAppNotificationStore mockInAppNotificationStore = activity.getStoreFactory().getInAppNotificationStore();
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) {
Object[] args = invocation.getArguments();
InAppNotificationStoreObserver u = (InAppNotificationStoreObserver) args[0];
u.onSyncError(mockErrorDescription);
return null;
}
}).when(mockInAppNotificationStore).addInAppNotificationObserver(any(InAppNotificationStoreObserver.class));
// attach fragment
attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
onView(withText(activity.getString(R.string.asset_upload_error__file_too_large__title))).check(isVisible());
}
use of com.waz.zclient.core.stores.inappnotification.IInAppNotificationStore in project wire-android by wireapp.
the class FileUploadTest method assertFileNotFoundWarningShowed.
@Test
@SuppressLint("NewApi")
public void assertFileNotFoundWarningShowed() throws InterruptedException {
final ErrorsList.ErrorDescription mockErrorDescription = mock(ErrorsList.ErrorDescription.class);
when(mockErrorDescription.getType()).thenReturn(ErrorType.CANNOT_SEND_ASSET_FILE_NOT_FOUND);
IInAppNotificationStore mockInAppNotificationStore = activity.getStoreFactory().getInAppNotificationStore();
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) {
Object[] args = invocation.getArguments();
InAppNotificationStoreObserver u = (InAppNotificationStoreObserver) args[0];
u.onSyncError(mockErrorDescription);
return null;
}
}).when(mockInAppNotificationStore).addInAppNotificationObserver(any(InAppNotificationStoreObserver.class));
// attach fragment
attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
onView(withText(activity.getString(R.string.asset_upload_error__not_found__title))).check(isVisible());
}
use of com.waz.zclient.core.stores.inappnotification.IInAppNotificationStore in project wire-android by wireapp.
the class AudioRecordingTest method assertRecordingFailureWarningShowed.
@Test
@SuppressLint("NewApi")
public void assertRecordingFailureWarningShowed() throws InterruptedException {
final ErrorsList.ErrorDescription mockErrorDescription = mock(ErrorsList.ErrorDescription.class);
when(mockErrorDescription.getType()).thenReturn(ErrorType.RECORDING_FAILURE);
IInAppNotificationStore mockInAppNotificationStore = activity.getStoreFactory().getInAppNotificationStore();
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) {
Object[] args = invocation.getArguments();
InAppNotificationStoreObserver u = (InAppNotificationStoreObserver) args[0];
u.onSyncError(mockErrorDescription);
return null;
}
}).when(mockInAppNotificationStore).addInAppNotificationObserver(any(InAppNotificationStoreObserver.class));
// attach fragment
attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
onView(withText(activity.getString(R.string.audio_message__recording__failure__title))).check(isVisible());
}
Aggregations