Exemplo n.º 1
0
        public void FindCommonAncestor_ItsOwnParent_ReturnsParent()
        {
            var file = new TestableFileBase("filename.ext", parentFolder, MockFileSystem);

            ITreeItem commonAncestor = file.FindCommonAncestor(parentFolder);

            commonAncestor.ShouldEqual(parentFolder);
        }
Exemplo n.º 2
0
        public void FindCommonAncestor_AFolderAndItsChild_ReturnsTheFolder()
        {
            var folder   = new Folder("Folder");
            var itsChild = new Folder("Its child", folder);

            ITreeItem commonAncestor = folder.FindCommonAncestor(itsChild);

            commonAncestor.ShouldEqual(folder);
        }
Exemplo n.º 3
0
        public void FindCommonAncestor_ItsOwnParent_ReturnsParent()
        {
            var parentFolder = new Folder("Parent Folder Name");

            var folder = new Folder("Folder Name", parentFolder);

            ITreeItem commonAncestor = folder.FindCommonAncestor(parentFolder);

            commonAncestor.ShouldEqual(parentFolder);
        }
Exemplo n.º 4
0
        public void FindCommonAncestor_TwoSiblings_ReturnsParent()
        {
            var parentFolder = new Folder("Parent Folder Name");

            var sibling1 = new Folder("Sibling 1", parentFolder);
            var sibling2 = new Folder("Sibling 2", parentFolder);

            ITreeItem commonAncestor = sibling1.FindCommonAncestor(sibling2);

            commonAncestor.ShouldEqual(parentFolder);
        }