示例#1
0
        public void Test_ContentPathParsing()
        {
            Assert.IsFalse(ContentPath.TryParse("", out ContentPath _));
            Assert.IsFalse(ContentPath.TryParse(".", out _));
            Assert.IsFalse(ContentPath.TryParse(".ff", out _));
            Assert.IsFalse(ContentPath.TryParse("3ff.", out _));

            var p1 = ContentPath.Parse("$.a.FAERF_Ar");
            var p2 = ContentPath.Root.Append("a").Append("FAERF_Ar");

            Assert.IsTrue(p1.Equals(p2));

            Assert.IsTrue(ContentPath.Parse("$").Equals(ContentPath.Root));


            Assert.IsTrue(p1.Equals(ContentPath.Parse(p1.ToString())));
            Assert.IsTrue(ContentPath.Root.Equals(ContentPath.Parse(ContentPath.Root.ToString())));
        }