Ejemplo n.º 1
0
        public void File_Url_Should_Update_After_Rename_Folder()
        {
            var connector = WebApiTestHelper.LoginAdministrator();

            var folder   = CreateNewFolder(connector);
            var folderId = Convert.ToInt32(folder.FolderID);
            var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files\\Test.png");

            connector.UploadCmsFile(filePath, folder.FolderPath.ToString());
            var fileId = GetFileId(folderId, "Test.png");

            var newFolderName = Guid.NewGuid().ToString();

            RenameFolder(connector, folderId, newFolderName);

            var getUrlApi = "API/DigitalAssets/ContentService/GetUrl";
            var fileUrl   = connector.PostJson(getUrlApi, new { fileId = fileId }, GetRequestHeaders()).Content.ReadAsStringAsync().Result;

            Assert.IsTrue(fileUrl.Contains(newFolderName));
        }