예제 #1
0
        public void Extract()
        {
            var @async = _api.ExtractAsync(_synoTestFolderNoSlash + "/test_compress.zip",
                                           _synoTestFolderNoSlash + "/test_extract");

            async.success.Should().BeTrue();

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

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

                Thread.Sleep(2000);
            }

            var stop = _api.ExtractStop(async.Data.taskid);

            stop.success.Should().BeTrue();

            var list = _api.ExtractListFiles(_synoTestFolderNoSlash + "/test_compress.zip");

            list.success.Should().BeTrue();
        }