@Test public void IsAvailable_WhenKeyPresent_ReturnsTrue(){ PreferenceHelper pm = mock(PreferenceHelper.class); when(pm.isDropboxAutoSendEnabled()).thenReturn(true); when(pm.getDropBoxAccessKeyName()).thenReturn("aaaaaa"); DropBoxManager dropBoxManager = new DropBoxManager(pm); assertThat("All values present means is available", dropBoxManager.isAvailable(), is(true)); }
@Override public boolean isAvailable() { return isLinked() && preferenceHelper.getDropBoxAccessKeyName() != null; }
DropBoxManager extends FileSender { @Override public boolean isAvailable() { return isLinked() && preferenceHelper.getDropBoxAccessKeyName() != null; } }
DropBoxManager extends FileSender { @Override public boolean isAvailable() { return isLinked() && preferenceHelper.getDropBoxAccessKeyName() != null; } DropBoxManager(PreferenceHelper preferenceHelper); }
DropBoxManager extends FileSender { @Override public boolean isAvailable() { return isLinked() && preferenceHelper.getDropBoxAccessKeyName() != null; } DropBoxManager(PreferenceHelper preferenceHelper); boolean isLinked(); boolean finishAuthorization(); void startAuthentication(Context context); void unLink(); @Override void uploadFile(List<File> files); @Override boolean isAvailable(); @Override boolean hasUserAllowedAutoSending(); void uploadFile(final String fileName); @Override boolean accept(File dir, String name); }
DropBoxManager extends FileSender { @Override public boolean isAvailable() { return isLinked() && preferenceHelper.getDropBoxAccessKeyName() != null; } DropBoxManager(PreferenceHelper preferenceHelper); boolean isLinked(); boolean finishAuthorization(); void startAuthentication(Context context); void unLink(); @Override void uploadFile(List<File> files); @Override boolean isAvailable(); @Override boolean hasUserAllowedAutoSending(); void uploadFile(final String fileName); @Override boolean accept(File dir, String name);  }