public void ChangeChildAndParentFoldersName() { //Arrange const int FolderID = 2; const int ProjectID = 4; Folder Folder3 = service.GetFolderByID(FolderID); string NewName = "KAlli"; //Act Folder Renamed = service.ChangeFolderName(ProjectID, FolderID, NewName); Assert.AreEqual(Folder3.Name, NewName); Assert.AreEqual(Folder3, Renamed); }
public ActionResult ChangeFolderName(int ProjectID, int FolderID, string NewName) { // If the user can open the project he can change the name on folders. if (Pservice.CanUserOpenProject(ProjectID, User.Identity.Name)) { // If we don't find the FolderChanged we throw an ArgumentException. var FolderChanged = FoService.ChangeFolderName(ProjectID, FolderID, NewName); if (FolderChanged != null) { // We return the FolderChanged, see JavaScript code for receiving end. return(Json(FolderChanged, JsonRequestBehavior.AllowGet)); } } throw new ArgumentException(); }