public void UploadFile(string path, string fileName, byte[] content, Action<DropBoxFile> onSuccess, Action<Exception> onError) { Client.UploadFileAsync(path, fileName, content, metaData => { var dropBoxFile = new DropBoxFile(fileName, path, content); onSuccess(dropBoxFile); }, dropBoxException => onError(dropBoxException) ); }
public void GetFileContent(string path, Action<DropBoxFile> onSuccess, Action<Exception> onError) { Client.GetFileAsync(path, response => { var fileContent = new DropBoxFile(Path.GetFileName(path), path, response.RawBytes); onSuccess(fileContent); }, dropBoxException => onError(dropBoxException)); }
public void Assure_ItemType_For_DropBoxFile_Is_File() { var file = new DropBoxFile("path", "name"); Assert.That(file.ItemType, Is.EqualTo(DropBoxItemType.File)); }
public void Assure_Item_Path_Is_Exposed() { var item = new DropBoxFile("full path", "name"); var viewModel = new DropBoxObjectViewModel(item); Assert.That(viewModel.FullPath, Is.EqualTo(item.FullPath)); }
public void Assure_Path_Is_Preserved() { const string path = "Full path here"; var file = new DropBoxFile(path, "name"); Assert.That(file.FullPath, Is.EqualTo(path)); }
public void Assure_Name_Is_Preserved() { const string name = "Filename"; var file = new DropBoxFile("folder", name); Assert.That(file.Name, Is.EqualTo(name)); }
public void UploadFile(string path, string fileName, byte[] content, Action<DropBoxFile> onSuccess, Action<Exception> onError) { UploadedFile = new DropBoxFile(path, fileName, content); onSuccess(UploadedFile); }