use of com.owncloud.android.lib.common.operations.RemoteOperationResult in project android by owncloud.
the class ErrorMessageAdapterUnitTest method getErrorCauseMessageForForbiddenRemoval.
@Test
public void getErrorCauseMessageForForbiddenRemoval() {
// Given a mocked set of resources passed to the object under test...
when(mMockResources.getString(R.string.forbidden_permissions)).thenReturn(MOCK_FORBIDDEN_PERMISSIONS);
when(mMockResources.getString(R.string.forbidden_permissions_delete)).thenReturn(MOCK_TO_DELETE);
// ... when method under test is called ...
String errorMessage = ErrorMessageAdapter.getErrorCauseMessage(new RemoteOperationResult(RemoteOperationResult.ResultCode.FORBIDDEN), new RemoveFileOperation(PATH_TO_DELETE, false), mMockResources);
// ... then the result should be the expected one.
assertThat(errorMessage, is(EXPECTED_ERROR_MESSAGE));
}
Aggregations