public void GetCommonDirectory() { AreEqual(PathExpansionPack.ConcatenateDirectoryPath("C:", "users", "user"), PathExpansionPack.GetCommonDirectory(Combine("C:", "users", "user", "Desktop"), Combine("C:", "users", "user"))); AreEqual(PathExpansionPack.ConcatenateDirectoryPath("C:", "users", "user"), PathExpansionPack.GetCommonDirectory(Combine("C:", "users", "user"), Combine("C:", "users", "user", "Desktop"))); AreEqual(PathExpansionPack.ConcatenateDirectoryPath("C:", "users"), PathExpansionPack.GetCommonDirectory(Combine("C:", "users", "user", "Desktop"), Combine("C:", "users", "Rekkon"))); AreEqual(PathExpansionPack.ConcatenateDirectoryPath("C:", "users"), PathExpansionPack.GetCommonDirectory(Combine("C:", "users", "user"), Combine("C:", "users", "Rekkon", "Desktop"))); }
public void GetPreviousPathDirectoryInNewPath() { AreEqual("Desktop", PathExpansionPack.GetPreviousPathDirectoryInNewPath(Combine("C:", "users", "user", "Desktop"), Combine("C:", "users", "user"))); AreEqual("user", PathExpansionPack.GetPreviousPathDirectoryInNewPath(Combine("C:", "users", "user", "Desktop"), Combine("C:", "users"))); AreEqual(null, PathExpansionPack.GetPreviousPathDirectoryInNewPath(Combine("C:", "users", "user"), Combine("C:", "users", "user", "Desktop"))); }
public void ConcatenateDirectoryPath() { AreEqual($"{Combine("C:", "users", "user")}{DirectorySeparatorChar}", PathExpansionPack.ConcatenateDirectoryPath("C:", "users", "user")); }
public void DeterminePathItemType() { AreEqual(PathItemType.Directory, PathExpansionPack.DeterminePathItemType($"{Combine("C:", "users", "user", "Desktop")}{DirectorySeparatorChar}")); AreEqual(PathItemType.Volume, PathExpansionPack.DeterminePathItemType($"C{VolumeSeparatorChar}")); AreEqual(PathItemType.File, PathExpansionPack.DeterminePathItemType(Combine("C:", "users", "user", "Desktop", "Some file.txt"))); }