use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderTest method compareTo_FolderAndFile.
@Test
public void compareTo_FolderAndFile() {
FileFolder folder = new FileFolder();
folder.setFullName("fileFolder");
FileFolder file = new FileFolder();
file.setDisplayName("fileFolder");
assertEquals(-1, folder.compareTo(file));
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileListRecyclerAdapterTest method testAreContentsTheSame_DifferentObjectNames.
@Test
public void testAreContentsTheSame_DifferentObjectNames() {
FileFolder fileFolder1 = new FileFolder();
fileFolder1.setDisplayName("fileFolder1");
fileFolder1.setSize(100);
FileFolder fileFolder2 = new FileFolder();
fileFolder2.setDisplayName("fileFolder2");
fileFolder2.setSize(100);
assertFalse(mAdapter.getItemCallback().areContentsTheSame(fileFolder1, fileFolder2));
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileListRecyclerAdapterTest method testAreContentsTheSame_DifferentFolderNames.
@Test
public void testAreContentsTheSame_DifferentFolderNames() {
FileFolder fileFolder1 = new FileFolder();
fileFolder1.setName("fileFolder1");
fileFolder1.setSize(100);
FileFolder fileFolder2 = new FileFolder();
fileFolder2.setName("fileFolder2");
fileFolder2.setSize(100);
assertFalse(mAdapter.getItemCallback().areContentsTheSame(fileFolder1, fileFolder2));
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileListRecyclerAdapterTest method testAreContentsTheSame_SameObjects.
@Test
public void testAreContentsTheSame_SameObjects() {
FileFolder fileFolder = new FileFolder();
fileFolder.setDisplayName("fileFolder");
fileFolder.setSize(0);
assertTrue(mAdapter.getItemCallback().areContentsTheSame(fileFolder, fileFolder));
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method getFirstPageFoldersRoot.
public static void getFirstPageFoldersRoot(CanvasContext canvasContext, boolean forceNetwork, final StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
final RestParams folderParams = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).build();
FileFolderAPI.getRootFolderForContext(adapter, canvasContext, new StatusCallback<FileFolder>() {
@Override
public void onResponse(@NonNull Response<FileFolder> response, @NonNull LinkHeaders linkHeaders, @NonNull ApiType type) {
FileFolderAPI.getFirstPageFolders(adapter, response.body().getId(), callback, folderParams);
}
}, params);
}
}
Aggregations