mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 10:49:04 +03:00
fix test & review comments
Signed-off-by: Jens Mueller <tschenser@gmx.de>
This commit is contained in:
parent
d8b9d109b1
commit
8bb654b5ef
3 changed files with 6 additions and 5 deletions
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package com.owncloud.android.utils;
|
package com.owncloud.android.util;
|
||||||
|
|
||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
@ -28,6 +28,7 @@ import com.owncloud.android.MainApp;
|
||||||
import com.owncloud.android.R;
|
import com.owncloud.android.R;
|
||||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||||
import com.owncloud.android.operations.RemoveFileOperation;
|
import com.owncloud.android.operations.RemoveFileOperation;
|
||||||
|
import com.owncloud.android.utils.ErrorMessageAdapter;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
@ -63,9 +64,9 @@ public class ErrorMessageAdapterUnitTest {
|
||||||
@Test
|
@Test
|
||||||
public void getErrorCauseMessageForForbiddenRemoval() {
|
public void getErrorCauseMessageForForbiddenRemoval() {
|
||||||
// Given a mocked set of resources passed to the object under test...
|
// Given a mocked set of resources passed to the object under test...
|
||||||
when(mMockResources.getString(R.string.forbidden_permissions))
|
Mockito.when(mMockResources.getString(R.string.forbidden_permissions))
|
||||||
.thenReturn(MOCK_FORBIDDEN_PERMISSIONS);
|
.thenReturn(MOCK_FORBIDDEN_PERMISSIONS);
|
||||||
when(mMockResources.getString(R.string.forbidden_permissions_delete))
|
Mockito.when(mMockResources.getString(R.string.forbidden_permissions_delete))
|
||||||
.thenReturn(MOCK_TO_DELETE);
|
.thenReturn(MOCK_TO_DELETE);
|
||||||
|
|
||||||
Account account = new Account("name", ACCOUNT_TYPE);
|
Account account = new Account("name", ACCOUNT_TYPE);
|
|
@ -1,4 +1,4 @@
|
||||||
package com.owncloud.android.utils;
|
package com.owncloud.android.util;
|
||||||
|
|
||||||
import com.owncloud.android.datamodel.OCFile;
|
import com.owncloud.android.datamodel.OCFile;
|
||||||
|
|
|
@ -140,7 +140,7 @@ public class RenameFileDialogFragment
|
||||||
((TextView)(getDialog().findViewById(R.id.user_input)))
|
((TextView)(getDialog().findViewById(R.id.user_input)))
|
||||||
.getText().toString().trim();
|
.getText().toString().trim();
|
||||||
|
|
||||||
if (TextUtils.isEmpty((newFileName))) {
|
if (TextUtils.isEmpty(newFileName)) {
|
||||||
DisplayUtils.showSnackMessage(getActivity(), R.string.filename_empty);
|
DisplayUtils.showSnackMessage(getActivity(), R.string.filename_empty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue