예제 #1
0
        public void Test_GetRelativePathWithError3()
        {
            IAbsoluteFilePath      filePathTo = @"C:\Dir1\File.txt".ToAbsoluteFilePath();
            IAbsoluteDirectoryPath absoluteDirectoryPathFrom = @"D:\Dir1".ToAbsoluteDirectoryPath();

            Assert.IsFalse(filePathTo.CanGetRelativePathFrom(absoluteDirectoryPathFrom));
            string failureReason;

            Assert.IsFalse(filePathTo.CanGetRelativePathFrom(absoluteDirectoryPathFrom, out failureReason));
            Assert.IsTrue(failureReason == @"Cannot compute relative path from 2 paths that are not on the same volume 
   PathFrom = ""D:\Dir1""
   PathTo   = ""C:\Dir1\File.txt""");
            filePathTo.GetRelativePathFrom(absoluteDirectoryPathFrom);
        }