public void AddChildToChildrenList_WhenChildIsNull_ThrowArgumentNullException() { var child = new ChildDir("child", mainDir); TestDelegate action = () => mainDir.AddChildToChildrenList(null); Assert.Throws <ArgumentNullException>(action); }
public void AutoGenerateChildrenFullName_WhenCalled_RenamesChildren() { var mainDirDescr = new DirDescription("cat1\\cat2\\cat3", "cat3"); var childDirDescr1 = new DirDescription("cat1\\cat1", "cat1"); var childDirDescr11 = new DirDescription("cat1\\cat11", "cat11"); var main = new MainDir(mainDirDescr); var child1 = new ChildDir(childDirDescr1, main); var child11 = new ChildDir(childDirDescr11, child1); child1.AddChildToChildrenList(child11); main.AddChildToChildrenList(child1); defaultDirManagement.AutoGenerateChildrenFullName(main); Assert.IsTrue(main.Description.FullName + "\\" + child1.Description.Name == child1.Description.FullName && child1.Description.FullName + "\\" + child11.Description.Name == child11.Description.FullName); }