Beispiel #1
0
        public void CanIdentifyParents()
        {
            GlobalPath path       = GlobalPath.FromString("othervolume:/level1/level2");
            GlobalPath parent1    = GlobalPath.FromString("othervolume:");
            GlobalPath parent2    = GlobalPath.FromString("othervolume:/level1");
            GlobalPath notParent1 = GlobalPath.FromString("othervolume:/sthelse");
            GlobalPath notParent2 = GlobalPath.FromString("othervolume:/level1/level2/level3");
            GlobalPath notParent3 = GlobalPath.FromString("othervolume2:/level1/level2");

            Assert.IsTrue(parent1.IsParent(path));
            Assert.IsTrue(parent2.IsParent(path));
            Assert.IsFalse(path.IsParent(path));
            Assert.IsFalse(notParent1.IsParent(path));
            Assert.IsFalse(notParent2.IsParent(path));
            Assert.IsFalse(notParent3.IsParent(path));
        }