Inheritance: DropBoxItem
Esempio n. 1
0
 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)
         );
 }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
 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));
 }
Esempio n. 5
0
 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));
 }
Esempio n. 6
0
 public void Assure_Name_Is_Preserved()
 {
     const string name = "Filename";
     var file = new DropBoxFile("folder", name);
     Assert.That(file.Name, Is.EqualTo(name));
 }
Esempio n. 7
0
 public void UploadFile(string path, string fileName, byte[] content, Action<DropBoxFile> onSuccess, Action<Exception> onError)
 {
     UploadedFile = new DropBoxFile(path, fileName, content);
     onSuccess(UploadedFile);
 }