public void Test_GetAbsolutePathPathWithError6() { DirectoryPathRelative directoryPathTo = new DirectoryPathRelative(@"..\..\Dir1"); Assert.IsFalse(directoryPathTo.CanGetAbsolutePathFrom(null)); directoryPathTo.GetAbsolutePathFrom(null); }
public void Test_GetAbsolutePath() { DirectoryPathRelative directoryPathTo; DirectoryPathAbsolute directoryPathFrom; directoryPathTo = new DirectoryPathRelative(@".."); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@"."); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir1"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@"..\Dir2"); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir2"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@"..\..\Dir4\Dir5"); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1\Dir2\Dir3"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir1\Dir4\Dir5"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@".\..\Dir4\Dir5"); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1\Dir2\Dir3"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir1\Dir2\Dir4\Dir5"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); }
public void Test_GetAbsolutePathPathWithError5() { DirectoryPathRelative directoryPathTo = DirectoryPathRelative.Empty; DirectoryPathAbsolute directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1"); Assert.IsFalse(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo.GetAbsolutePathFrom(directoryPathFrom); }
public void Test_GetAbsolutePathPathWithError6() { DirectoryPathRelative directoryPathTo = new DirectoryPathRelative(@"..\..\Dir1"); Assert.IsFalse(directoryPathTo.CanGetAbsolutePathFrom(null)); directoryPathTo.GetAbsolutePathFrom(null); }
public void Test_GetAbsolutePathPathWithError4() { DirectoryPathRelative directoryPathTo = new DirectoryPathRelative(@"..\..\Dir1"); DirectoryPathAbsolute directoryPathFrom = DirectoryPathAbsolute.Empty; Assert.IsFalse(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo.GetAbsolutePathFrom(directoryPathFrom); }
public void Test_GetAbsolutePath() { DirectoryPathRelative directoryPathTo; DirectoryPathAbsolute directoryPathFrom; directoryPathTo = new DirectoryPathRelative(@".."); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@"."); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir1"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@"..\Dir2"); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir2"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@"..\..\Dir4\Dir5"); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1\Dir2\Dir3"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir1\Dir4\Dir5"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); directoryPathTo = new DirectoryPathRelative(@".\..\Dir4\Dir5"); directoryPathFrom = new DirectoryPathAbsolute(@"C:\Dir1\Dir2\Dir3"); Assert.IsTrue(directoryPathTo.GetAbsolutePathFrom(directoryPathFrom).Path == @"C:\Dir1\Dir2\Dir4\Dir5"); Assert.IsTrue(directoryPathTo.CanGetAbsolutePathFrom(directoryPathFrom)); }