public void ToHtml() { var result = Pygmentize.Content("class Foo { }") .WithLexer(new CSharpLexer()) .ToHtml() .AsString(); Check.That(result).StartsWith("<div class=\"highlight\" >"); }
public void BaseCase() { var result = Pygmentize.Content("") .WithLexer(new PlainLexer()) .WithFormatter(new NullFormatter()) .AsString(); Check.That(result).IsEqualTo(""); }
public void ToFile() { var file = Path.GetTempFileName() + ".html"; //autodetects output formatter from filename Pygmentize.Content("class Foo { }") .WithLexer(new CSharpLexer()) .ToFile(file); var result = File.ReadAllText(file); Check.That(result).StartsWith("<div class=\"highlight\" >"); }