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); }
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); }
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); }