public void RemoveFileFolderTest() { var api = new MailRuCloud(); api.Account = this.account; var result = api.UploadFileAsync(new FileInfo(@"C:\Development\MailRuCloudApi\1.txt"), "/"); var file = api.GetItems("/").Files.First(x => x.Name == "1.txt"); api.Remove(file); api.CreateFolder("new test folder", "/"); var folder = api.GetItems("/").Folders.First(x => x.Name == "new test folder"); api.Remove(folder); }
public void RenameTest() { var api = new MailRuCloud(); api.Account = this.account; var result = api.UploadFileAsync(new FileInfo(@"D:\1.stl"), "/"); if (result.Result) { var file = api.GetItems("/").Files.First(x => x.Name == "1.stl"); api.Rename(file, "rename stl test.stl"); api.CreateFolder("new test folder", "/"); var folder = api.GetItems("/").Folders.First(x => x.Name == "new test folder"); api.Rename(folder, "rename folder test"); var entry = api.GetItems("/"); Assert.IsNotNull(entry.Folders.FirstOrDefault(x => x.Name == "rename folder test")); Assert.IsNotNull(entry.Files.FirstOrDefault(x => x.Name == "rename stl test.stl")); } }