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()); }
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()); }
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()); }
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()); }
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()); }