Esempio n. 1
0
        public void ToHtml()
        {
            var result = Pygmentize.Content("class Foo { }")
                         .WithLexer(new CSharpLexer())
                         .ToHtml()
                         .AsString();

            Check.That(result).StartsWith("<div class=\"highlight\" >");
        }
Esempio n. 2
0
        public void BaseCase()
        {
            var result = Pygmentize.Content("")
                         .WithLexer(new PlainLexer())
                         .WithFormatter(new NullFormatter())
                         .AsString();


            Check.That(result).IsEqualTo("");
        }
Esempio n. 3
0
        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\" >");
        }