예제 #1
0
        public void Md5()
        {
            _api.Upload(new FileInfo(_md5TestImage), _synoTestFolderNoSlash);

            var md5 = _api.GetFileMd5Async(_synoTestFolderNoSlash + "/md5test.jpg");

            md5.success.Should().BeTrue();

            md5.Data.taskid.Should().NotBeNullOrEmpty();

            GetFileMd5StatusResponse status = null;

            for (var i = 0; i < 10; i++)
            {
                status = _api.GetFileMd5Status(md5.Data.taskid);
                status.success.Should().BeTrue();
                if (status.Data.finished)
                {
                    break;
                }

                Thread.Sleep(2000);
            }

            status.success.Should().BeTrue();
            status.Data.finished.Should().BeTrue();
        }