コード例 #1
0
 public ActionResult RemoveFolder(int?id, int projectId)
 {
     if (id == null)
     {
         return(View());
     }
     folderrepository.RemoveFolderByID((int)id);
     return(RedirectToAction("Index", "Project", new { id = projectId }));
 }
コード例 #2
0
        public void TestRemoveFolder()
        {
            //Arrange
            var newFolder = new Folder()
            {
                ID = 6, Name = "Folder6", IsRoot = false, SubFolders = new List <Folder>(), Files = new List <File>()
            };

            _folder.AddFolder(newFolder);
            //Act
            _folder.RemoveFolderByID(newFolder.ID);
            var getFolder = _folder.GetFolderByID(newFolder.ID);

            //Assert
            Assert.IsNull(getFolder);
        }