public void Windows_paths(string toPath, string expectedRelativePath) { // Arrange var configuration = new SiteConfiguration { SourcePath = @"C:\documents\blog\source" }; expectedRelativePath = expectedRelativePath.Replace("\\", Path.DirectorySeparatorChar.ToString()); // Act var relativePath = configuration.GetRelativePath(toPath); // Assert Assert.That(relativePath, Is.EqualTo(expectedRelativePath)); }
public void Unix_paths(string toPath, string expectedRelativePath) { // Arrange var configuration = new SiteConfiguration { SourcePath = @"/home/blog/source" }; expectedRelativePath = expectedRelativePath.Replace("/", Path.DirectorySeparatorChar.ToString()); // Act var relativePath = configuration.GetRelativePath(toPath); // Assert Assert.That(relativePath, Is.EqualTo(expectedRelativePath)); }