Beispiel #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);
        }
Beispiel #2
0
        public void InvalidNestingCdArg()
        {
            var path = new SgtPath("/");

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

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

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

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

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

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

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

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

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

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