public void Test_ConvertMarkdownToHtml_OnBigSample()
        {
            var converter = new MarkdownToHtmlConverter();
            var text = GetSampleMarkdown();
            var expected = GetSampleHtml();

            var actual = converter.ConvertMarkdownToHtml(text);

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
 static void Main(string[] args)
 {
     if (args.Length < 1)
     {
         Console.WriteLine("Please pass filename as the first argument");
         return;
     }
     var text = File.ReadAllText(args[0]);
     var html = new MarkdownToHtmlConverter().ConvertMarkdownToHtml(text);
     File.WriteAllText("output.html", html);
 }
        public void Test_PerformanceOf_ConvertMarkdownToHtml_OnLongStringOfSameSymbols()
        {
            var converter = new MarkdownToHtmlConverter();
            var text = String.Join("\n\n  \n", Enumerable.Repeat("a", 100000));

            var stopwatch = new Stopwatch();
            stopwatch.Start();
            converter.ConvertMarkdownToHtml(text);
            stopwatch.Stop();

            Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, 1500);
        }
        public void Test_PerformanceOf_ConvertMarkdownToHtml_OnLongString()
        {
            var converter = new MarkdownToHtmlConverter();
            var text = String.Join("\n\n  \n", Enumerable.Repeat("_bold __coursive___ `c_ode`", 100000));

            var stopwatch = new Stopwatch();
            stopwatch.Start();
            converter.ConvertMarkdownToHtml(text);
            stopwatch.Stop();

            Assert.LessOrEqual(stopwatch.ElapsedMilliseconds, 8000);
        }
예제 #5
0
파일: Md.cs 프로젝트: Klim0o0/clean-code
        private static string RenderParagraph(string paragraph)
        {
            var tags = Tags.BuildTags(paragraph);

            return(MarkdownToHtmlConverter.Convert(paragraph, tags.PairTags, tags.SingleTags));
        }
예제 #6
0
파일: Md.cs 프로젝트: Arteeck/clean-code
 private static string RenderParagraph(string paragraph, IEnumerable <Tag> tags)
 {
     return(MarkdownToHtmlConverter.Convert(paragraph, tags));
 }