示例#1
0
 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")));
 }
示例#2
0
 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")));
 }
示例#3
0
 public void ConcatenateDirectoryPath()
 {
     AreEqual($"{Combine("C:", "users", "user")}{DirectorySeparatorChar}", PathExpansionPack.ConcatenateDirectoryPath("C:", "users", "user"));
 }
示例#4
0
 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")));
 }