public void DeleteAsync() { _api.AddFolder(_synoTestFolderNoSlash, "test_upload"); _api.Upload(new FileInfo(_localTestImage), _synoTestFolderNoSlash + "/test_upload"); var async = _api.DeleteAsync(_synoTestFolderNoSlash + "/test_upload/synologybox.jpg"); async.success.Should().BeTrue(); async.Data.taskid.Should().NotBeNullOrEmpty(); for (var i = 0; i < 10; i++) { var status = _api.DeleteStatus(async.Data.taskid); status.success.Should().BeTrue(); if (status.Data.finished) { break; } Thread.Sleep(2000); } var stop = _api.DeleteStop(async.Data.taskid); stop.success.Should().BeTrue(); }
public void CopyMove() { _api.Delete(_synoTestFolderNoSlash + "/synologybox.jpg", false); _api.AddFolder(_synoTestFolderNoSlash, "test"); var @async = _api.CopyMoveAsync(_synoTestFolderNoSlash + "/synologybox.jpg", _synoTestFolderNoSlash + "/test"); async.success.Should().BeTrue(); async.Data.taskid.Should().NotBeNullOrEmpty(); for (var i = 0; i < 10; i++) { Thread.Sleep(2000); var status = _api.CopyMoveStatus(async.Data.taskid); status.success.Should().BeTrue(); if (status.Data.finished) { break; } } BaseSynologyResponse stop = _api.CopyMoveStop(async.Data.taskid); stop.success.Should().BeTrue(); }