Ejemplo n.º 1
0
            public void Clearing()
            {
                PathRef pathRef = new PathRef("DirA/DirB");

                pathRef.Clear();
                Assert.That(pathRef.PosixPath, Is.EqualTo(""));
            }
Ejemplo n.º 2
0
            public void When_UsingClearOnEmptyPath()
            {
                PathRef pathRef = new PathRef();

                Assert.That(() => { pathRef.Clear(); }, Throws.Nothing);
                Assert.That(pathRef.IsEmpty, Is.True);
                Assert.That(pathRef.ToString(), Is.EqualTo(""));
            }
Ejemplo n.º 3
0
            public void When_UsingClearOnAbsolutePath(string input)
            {
                PathRef pathRef = new PathRef(input);

                Assert.That(() => { pathRef.Clear(); }, Throws.Nothing);
                Assert.That(pathRef.IsAbsolute, Is.True);
                Assert.That(pathRef.IsEmpty, Is.False);
                Assert.That(pathRef.ToString(), Is.EqualTo(@"\"));
            }
Ejemplo n.º 4
0
            public void When_UsingClearOnNullPath()
            {
                PathRef pathRef = new PathRef(null);

                Assert.That(() => { pathRef.Clear(); }, Throws.Nothing);
                Assert.That(pathRef.IsNull, Is.True);
                Assert.That(pathRef.IsEmpty, Is.False);
                Assert.That(pathRef.ToString(), Is.Null);
            }
Ejemplo n.º 5
0
            public void When_UsingClearOnRelativePath(string input)
            {
                PathRef pathRef = new PathRef(input);

                Assert.That(() => { pathRef.Clear(); }, Throws.Nothing);
                Assert.That(pathRef.IsRelative, Is.True);
                Assert.That(pathRef.IsEmpty, Is.True);
                Assert.That(pathRef.ToString(), Is.EqualTo(""));
            }
Ejemplo n.º 6
0
            public void Rooting()
            {
                PathRef pathRef = new PathRef("C:/DirA");

                Assert.That(pathRef.IsRooted, Is.True);
                pathRef.JoinWith("../../../..");
                Assert.That(pathRef.PosixPath, Is.EqualTo(@"C:"));
                pathRef.Clear();
                Assert.That(pathRef.IsRooted, Is.False);
            }