Ejemplo n.º 1
0
        public void PublicUnpublishLink()
        {
            var api = new MailRuCloud();

            api.Account = this.account;

            var items          = api.GetItems("/Camera Uploads");
            var fileToDownload = items.Files.First(t => t.Size <= 1 * 1024 * 1024);
            var publicFileLink = api.GetPublishLink(fileToDownload);

            var folder            = new Folder(0, 0, "Camera Uploads", 0, "/Camera Uploads");
            var publishFolderLink = api.GetPublishLink(folder);

            Assert.IsTrue(!string.IsNullOrEmpty(publicFileLink));
            Assert.IsTrue(!string.IsNullOrEmpty(publishFolderLink));

            var unpublishFile   = api.UnpublishLink(fileToDownload, publicFileLink);
            var unpublishFolder = api.UnpublishLink(folder, publishFolderLink);

            Assert.IsTrue(unpublishFile);
            Assert.IsTrue(unpublishFolder);
        }
Ejemplo n.º 2
0
        public void GetPublishDirectLinkTest()
        {
            var api = new MailRuCloud();

            api.Account = this.account;

            var items          = api.GetItems("/Camera Uploads");
            var fileToDownload = items.Files.First(t => t.Size <= 1 * 1024 * 1024);
            var publicFileLink = api.GetPublishLink(fileToDownload);

            Assert.IsTrue(!string.IsNullOrEmpty(publicFileLink));

            var directLink = api.GetPublishDirectLink(publicFileLink);

            Assert.IsTrue(!string.IsNullOrEmpty(directLink));

            var unpublishFile = api.UnpublishLink(fileToDownload, publicFileLink);

            Assert.IsTrue(unpublishFile);
        }