コード例 #1
0
 public void RelativePath()
 {
     Assert.AreEqual(@"folder2\folder3", ProjectPath.RelativePath(
                         @"c:\folder1", @"c:\folder1\folder2\folder3"));
     Assert.AreEqual(@"..\folder2\folder3", ProjectPath.RelativePath(
                         @"c:\folder1", @"c:\folder2\folder3"));
     Assert.AreEqual(@"bin\debug", ProjectPath.RelativePath(
                         @"c:\folder1", @"bin\debug"));
     Assert.IsNull(ProjectPath.RelativePath(@"C:\folder", @"D:\folder"),
                   "Unrelated paths should return null");
 }