Example #1
0
 public void SimpleCommonRoot()
 {
     PathOperations.FindCommonRoot(new[]
     {
         Path.Combine("a", "1.txt"),
         Path.Combine("a", "2.txt")
     })
     .Should().Be("a" + Path.DirectorySeparatorChar);
 }
Example #2
0
 public void CommonRootWithDifferentSubDirs()
 {
     PathOperations.FindCommonRoot(new[] { @"a\b\1.txt", @"a\c\2.txt" }).Should().Be(@"a\");
     PathOperations.FindCommonRoot(new[] { @"a\b\1.txt", @"a\c\2.txt", @"a\3.txt" }).Should().Be(@"a\");
 }
Example #3
0
 public void SimpleCommonRoot()
 {
     PathOperations.FindCommonRoot(new[] { @"a\1.txt", @"a\2.txt" }).Should().Be(@"a\");
 }
Example #4
0
 public void SingleFile()
 {
     PathOperations.FindCommonRoot(new[] { @"a\b\c\x.y" }).Should().Be(@"a\b\c\");
 }
Example #5
0
 public void EmptySet()
 {
     PathOperations.FindCommonRoot(new string[0]).Should().BeEmpty();
 }
Example #6
0
 public void CommonRootWithDifferentSubDirs()
 {
     PathOperations.FindCommonRoot(new[] { Path.Combine("a", "b", "1.txt"), Path.Combine("a", "c", "2.txt") }).Should().Be("a" + Path.DirectorySeparatorChar);
     PathOperations.FindCommonRoot(new[] { Path.Combine("a", "b", "1.txt"), Path.Combine("a", "c", "2.txt"), Path.Combine("a", "3.txt") }).Should().Be("a" + Path.DirectorySeparatorChar);
 }
Example #7
0
 public void SingleFile()
 {
     PathOperations.FindCommonRoot(new[] { Path.Combine("a", "b", "c", "x.y") })
     .Should().Be(Path.Combine("a", "b", "c") + Path.DirectorySeparatorChar);
 }