Example #1
0
        public void TestGetParentFolder()
        {
            //Arrange
            var parent = new Folder()
            {
                ID = 6, Name = "Folder6", IsRoot = true, SubFolders = new List <Folder>(), Files = new List <File>()
            };
            var child = new Folder()
            {
                ID = 7, Name = "Folder7", ParentID = 6, Parent = parent, IsRoot = false, SubFolders = new List <Folder>(), Files = new List <File>()
            };

            //Act
            parent.SubFolders.Add(child);
            _folder.AddFolder(parent);
            _folder.AddFolder(child);
            //Assert
            Assert.AreEqual(parent, _folder.GetParentFolder(child));
        }