예제 #1
0
        public void Upload_GetThumb_Download()
        {
            var local          = new FileInfo(_localTestImage);
            var downloadedName = _localTestFolderNoSlash + "\\dload_" + local.Name;

            if (System.IO.File.Exists(downloadedName))
            {
                System.IO.File.Delete(downloadedName);
            }

            var res = _api.Upload(new FileInfo(_localTestImage), _synoTestFolderNoSlash);

            res.success.Should().BeTrue();

            var thumb = _api.GetThumb(_synoTestFolderNoSlash + "/" + local.Name);

            thumb.Length.Should().BeGreaterThan(1);

            Thread.Sleep(3000);

            var file = _api.Download(_synoTestFolderNoSlash + "/" + local.Name);

            file.Length.Should().Be((int)local.Length);
        }