public void RelativeTo_WithParentLackingDrive_ThrowsException() { var parent = new MockPath(@"\users\"); var path = new MockPath(@"c:\users\nemec\file.txt"); path.RelativeTo(parent); }
public void RelativeTo_WithParentInDifferentDir_ThrowsException() { var parent = new MockPath(@"\Program Files\"); var path = new MockPath(@"c:\users\nemec\file.txt"); path.RelativeTo(parent); }
public void RelativeTo_WithParentContainingPartialFilename_ThrowsException() { var parent = new MockPath(@"c:\users\nemec\file"); var path = new MockPath(@"c:\users\nemec\file.txt"); path.RelativeTo(parent); }
public void RelativeTo_WithParentLackingDrive_ThrowsException() { var parent = new MockPath(@"\users\"); var path = new MockPath(@"c:\users\nemec\file.txt"); Assert.Throws <ArgumentException>(() => path.RelativeTo(parent)); }
public void RelativeTo_WithParent_IsAbsoluteIsFalse() { var parent = new MockPath(@"c:\users\"); var path = new MockPath(@"c:\users\nemec\file.txt"); path.RelativeTo(parent); Assert.IsTrue(path.IsAbsolute()); }
public void RelativeTo_WithLongUncPath_ReturnsRelativePath() { var expected = new MockPath(@"subdir\file.exe"); var parent = new MockPath(@"\\some\share\"); var path = new MockPath(@"\\some\share\subdir\file.exe"); var actual = path.RelativeTo(parent); Assert.AreEqual(expected, actual); }
public void RelativeTo_WithLongPath_ReturnsRelativePath() { var expected = new MockPath(@"nemec\tmp\filestorage\file.txt"); var parent = new MockPath(@"c:\users\"); var path = new MockPath(@"c:\users\nemec\tmp\filestorage\file.txt"); var actual = path.RelativeTo(parent); Assert.AreEqual(expected, actual); }
public void RelativeTo_WithParent_ReturnsRelativePath() { var expected = new MockPath(@"nemec\file.txt"); var parent = new MockPath(@"c:\users\"); var path = new MockPath(@"c:\users\nemec\file.txt"); var actual = path.RelativeTo(parent); Assert.Equal(expected, actual); }