Esempio n. 1
0
        public void WillSetDefaults()
        {
            var fs    = new TestFileSystem();
            var bs    = new TestBlogServer();
            var shell = new Application(
                new TestLogger <Application>(),
                fs,
                bs,
                new PipelineFactory(fs, bs));

            shell.SetDefaults();

            Assert.True(!string.IsNullOrEmpty(shell.Path));
        }
        public void UploadsImagesAndAddsUrlToHtml()
        {
            var fs = new TestFileSystem();
            var bs = new TestBlogServer();

            var text =
                @"# Hello 
Some text
![diagram](/somediagram.png)
More text
<img width='636' height='687' align='right' style='margin: 0px 0px 10px 10px; float: right; display: inline; background - image: none; ' alt='Azure Application Insights Extension' src='diagram.png' border='0'>
";
            var pipeline =
                new MarkdownPipelineBuilder()
                .UsePreCode()
                .UseImageProcessing(fs, bs)
                .Build();

            var html = Markdown.ToHtml(text, pipeline);

            Assert.Contains("src=\"https://server/images3/diagram\"", html);
        }
        public void UploadsImagesAndAddsUrlToHtml()
        {
            var fs = new TestFileSystem();
            var bs = new TestBlogServer();

            var text =
                @"# Hello 
Some text
![diagram](/somediagram.png){ .image-center }
More text
";
            var pipeline =
                new MarkdownPipelineBuilder()
                .UsePreCode()
                .UseImageProcessing(fs, bs)
                .UseGenericAttributes()
                .Build();

            var html = Markdown.ToHtml(text, pipeline);

            Assert.Contains("https://server/images3/diagram", html);
            Assert.Contains("class=\"image-center\"", html);
        }