Ejemplo n.º 1
0
        public void CreatePath_WithMultipleStringPaths_CombinesPaths()
        {
            // Arrange
            const string someInitialPath = "/home/dan";
            const string someSubPath     = "music";

            // Act
            var path = new PurePosixPath(someInitialPath, someSubPath);

            // Assert
            Assert.AreEqual("/home/dan/music", path.ToPosix());
        }
Ejemplo n.º 2
0
        public void CreatePath_WithExtraDoubleDots_KeepsDoubleDots()
        {
            // Arrange
            var paths = new[] { "foo/../bar" };
            const string expected = "foo/../bar";

            // Act
            var path = new PurePosixPath(paths);

            // Assert
            Assert.AreEqual(expected, path.ToPosix());
        }
Ejemplo n.º 3
0
        public void CreatePath_WithExtraSlashes_RemovesExtraSlashes()
        {
            // Arrange
            var paths = new[] { "foo//bar" };
            const string expected = "foo/bar";

            // Act
            var path = new PurePosixPath(paths);

            // Assert
            Assert.AreEqual(expected, path.ToPosix());
        }
Ejemplo n.º 4
0
        public void CreatePath_WithMultipleStringPaths_CombinesPaths()
        {
            // Arrange
            const string someInitialPath = "/home/dan";
            const string someSubPath = "music";

            // Act
            var path = new PurePosixPath(someInitialPath, someSubPath);

            // Assert
            Assert.AreEqual("/home/dan/music", path.ToPosix());
        }
Ejemplo n.º 5
0
        public void CreatePath_WithMultipleAbsolutePaths_UsesLastPathAsAnchor()
        {
            // Arrange
            var paths = new[]{ "/home/dan", "/lib", "lib64" };
            const string expected = "/lib/lib64";

            // Act
            var path = new PurePosixPath(paths);

            // Assert
            Assert.AreEqual(expected, path.ToPosix());
        }