Ejemplo n.º 1
0
        public void CouldCreateExternalRepoPath()
        {
            var str = "@a/b/c/";
            var p   = new DataPathStruct(str);

            Assert.AreEqual(3, p.Level);
            Assert.AreEqual(7, p.Length);
            Assert.AreEqual(str, p.ToString());
            Assert.IsTrue(p.IsRepo);
            Assert.IsTrue(p.IsExternal);
        }
Ejemplo n.º 2
0
        public void CouldCreatePath()
        {
            var str = "a/b/c";
            var p   = new DataPathStruct(str);

            Assert.AreEqual(2, p.Level);
            Assert.AreEqual(5, p.Length);
            Assert.AreEqual(str, p.ToString());
            Assert.IsFalse(p.IsRepo);
            Assert.IsFalse(p.IsExternal);
        }
Ejemplo n.º 3
0
        public void CouldGetParent()
        {
            var p      = new DataPathStruct("a/b/c");
            var parent = p.Parent();

            Assert.AreEqual("a/b/", parent.ToString());
            Assert.AreEqual(2, parent.Level);

            parent = parent.Parent();
            Assert.AreEqual("a/", parent.ToString());
            Assert.AreEqual(1, parent.Level);

            parent = parent.Parent();
            Assert.AreEqual("", parent.ToString());
            Assert.AreEqual(0, parent.Level);

            parent = new DataPathStruct("a").Parent();
            Assert.AreEqual("", parent.ToString());
            Assert.AreEqual(0, parent.Level);
        }