示例#1
0
        public void SafeJoin_WithSiblinStartsWithTraversal_FailsJoin()
        {
            var path = new MockPath(@"a");

            MockPath joined;

            Assert.IsFalse(path.TrySafeJoin(@"..\ab\d", out joined));
        }
示例#2
0
        public void SafeJoin_WithComplexRelativeParentTraversal_FailsJoin()
        {
            var path = new MockPath(@"a");

            MockPath joined;

            Assert.IsFalse(path.TrySafeJoin(@"b\c\d\..\f\..\..\..\g\..\..", out joined));
        }
示例#3
0
        public void SafeJoin_WithSiblingRelativeParentTraversal_FailsJoin()
        {
            var path = new MockPath(@"a");

            MockPath joined;

            Assert.IsFalse(path.TrySafeJoin(@"..\c\d", out joined));
        }
示例#4
0
        public void SafeJoin_WithRelative_CreatesPathEqualToCombinedPath()
        {
            var path     = new MockPath(@"a");
            var expected = new MockPath(@"a\b");

            MockPath joined;

            Assert.IsTrue(path.TrySafeJoin("b", out joined));

            Assert.AreEqual(expected, joined);
        }