Exemple #1
0
        public void ShouldAddHtmlHeadAndBodyTags()
        {
            // Arrange & Act
            var destination = SetupAndTransform(src => WriteText(src, "a.md", "foo"));

            // Assert
            var file = Path.Combine(destination, "a.html");

            TestContext.AddResultFile(file);
            TextFileAssert.StartsWith(file, "<!DOCTYPE html><html><head><title>a</title></head><body>");
            TextFileAssert.Contains(file, "foo");
            TextFileAssert.EndsWith(file, "</body></html>");
        }
Exemple #2
0
        public void ShouldTransformFileWithHeaderAndFooter()
        {
            // Arrange
            var directory    = TestDirectory();
            var markdownFile = Path.Combine(directory, "test.md");

            File.WriteAllText(markdownFile, "### Content");
            var htmlFile = Path.Combine(directory, "test.html");
            var header   = "~~ Header! ~~";
            var footer   = "@@ Footer! @@";

            // Act
            Subject.TransformFile(markdownFile, htmlFile, header, footer);

            // Assert
            TextFileAssert.StartsWith(htmlFile, header);
            TextFileAssert.Contains(htmlFile, "<h3>Content");
            TextFileAssert.EndsWith(htmlFile, footer);
        }