public void Test_ConvertMarkdownToHtml_OnBigSample() { var converter = new MarkdownToHtmlConverter(); var text = GetSampleMarkdown(); var expected = GetSampleHtml(); var actual = converter.ConvertMarkdownToHtml(text); Assert.AreEqual(expected, actual); }
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); }
private static string RenderParagraph(string paragraph) { var tags = Tags.BuildTags(paragraph); return(MarkdownToHtmlConverter.Convert(paragraph, tags.PairTags, tags.SingleTags)); }
private static string RenderParagraph(string paragraph, IEnumerable <Tag> tags) { return(MarkdownToHtmlConverter.Convert(paragraph, tags)); }