Exemple #1
0
        public void InvalidFormatCdArg6()
        {
            var path = new SgtPath("/");

            var ex = Assert.Throws <ArgumentException>(() => path.Cd("abc"));

            Assert.That(ex.Message == SgtPath.InvalidArgumentFormatMessage, () => ex.Message);
        }
Exemple #2
0
        public void InvalidNestingCdArg()
        {
            var path = new SgtPath("/");

            var ex = Assert.Throws <ArgumentException>(() => path.Cd(".."));

            Assert.That(ex.Message == SgtPath.InvalidArgumentNestingMessage, () => ex.Message);
        }
Exemple #3
0
        public void CdToAbs3()
        {
            var path = new SgtPath("/abc/xyz");

            Assert.AreEqual(path.Cd("/abcf/xyzf"), "/abcf/xyzf");
        }
Exemple #4
0
        public void CdToAbs2()
        {
            var path = new SgtPath("/");

            Assert.AreEqual(path.Cd("/aBc/xyz"), "/aBc/xyz");
        }
Exemple #5
0
        public void CdDownTo1From1()
        {
            var path = new SgtPath("/abc");

            Assert.AreEqual(path.Cd("./xyz"), "/abc/xyz");
        }
Exemple #6
0
        public void CdDownTo0From0()
        {
            var path = new SgtPath("/");

            Assert.AreEqual(path.Cd("."), "/");
        }
Exemple #7
0
        public void CdUpTo2AndDown()
        {
            var path = new SgtPath("/abc/def/hgj");

            Assert.AreEqual(path.Cd("../../wxy"), "/abc/wxy");
        }
Exemple #8
0
        public void CdUpTo2()
        {
            var path = new SgtPath("/abc/def/hgj");

            Assert.AreEqual(path.Cd("../.."), "/abc");
        }
Exemple #9
0
        public void CdUpToRootL2DownF()
        {
            var path = new SgtPath("/abc/def");

            Assert.AreEqual(path.Cd("../../def"), "/def");
        }
Exemple #10
0
        public void CdUpToRootL1()
        {
            var path = new SgtPath("/abc");

            Assert.AreEqual(path.Cd(".."), "/");
        }