コード例 #1
0
        //[TestMethod]
        public void GetAccountTest()
        {
            var dropboxClient = new DropboxWrapper();
            Task task = dropboxClient.GetAccount();
            task.Wait();

            Assert.IsTrue(dropboxClient.Account != null);
        }
コード例 #2
0
        //[TestMethod]
        public void LoadFileListTest()
        {
            var dropboxClient = new DropboxWrapper();
            Task task = dropboxClient.LoadFileList();
            task.Wait();

            Assert.IsTrue(dropboxClient.Files.Count == 1);
        }
コード例 #3
0
        //[TestMethod]
        public void DownloadTest()
        {
            const string folder = "";
            const string file = "test.sfs";

            var dropboxClient = new DropboxWrapper();
            Task task = dropboxClient.Download(folder, file);
            task.Wait();

            Assert.IsTrue(dropboxClient.LastDownloadedFile != null);
            Assert.IsTrue(dropboxClient.LastDownloadedFile.Length == 709);

            File.WriteAllBytes("dropboxTest2.sfs", dropboxClient.LastDownloadedFile);

            Assert.IsTrue(FileEquals("dropboxTest.sfs", "dropboxTest2.sfs"));
        }
コード例 #4
0
        //[TestMethod]
        public void UploadTest()
        {
            const string folder = "";
            const string file = "test.sfs";

            byte[] content;
            using (FileStream fileStream = File.OpenRead("dropboxTest.sfs"))
            {
                content = new byte[fileStream.Length];

                fileStream.Read(content, 0, (int) fileStream.Length);
                fileStream.Close();
            }

            var dropboxClient = new DropboxWrapper();
            Task task = dropboxClient.Upload(folder, file, content, delegate {  });
            task.Wait();
        }
コード例 #5
0
 public DropboxService(IMessenger messenger)
 {
     _messenger = messenger;
     _dropbox = new DropboxWrapper();
 }