Example #1
0
        public void TestGetDownloadFromResource()
        {
            var layout = Layout.Create()
                         .Add("legal", ModMarkdown.Page(Data.FromFile("./Resources/legal.md")));

            using (var runner = TestRunner.Run(layout))
            {
                var response = runner.GetResponse("/legal");
                Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            }
        }
Example #2
0
        public void TestMarkdownPage()
        {
            var page = ModMarkdown.Page(Data.FromString("# Hello World!"))
                       .Title("Markdown Page")
                       .Description("A page rendered with markdown");

            using var runner = TestRunner.Run(page);

            using var response = runner.GetResponse();

            var content = response.GetContent();

            Assert.Contains("<h1 id=\"hello-world\">Hello World!</h1>", content);
        }