Ejemplo n.º 1
0
            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));
            }
Ejemplo n.º 2
0
            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));
            }