コード例 #1
0
 public void EnsureOneParagraphPerCitation()
 {
     AddCitation("cite0", "fullText0");
     AddCitation("cite1", "fullText1");
     foreach ((string name, ICitation _) in citations)
     {
         builder.AppendReference(name, TextStyle.Normal);
     }
     builder.WriteBibliography();
     // Should be 4 elements in the document - 1 paragraph containing the two
     // citations above, second paragraph for bibliography heading, then two
     // more paragraphs, one for each reference in the bibliography.
     Assert.AreEqual(4, doc.LastSection.Elements.Count);
 }
コード例 #2
0
 /// <summary>
 /// Render the given reference inline object to the PDF document.
 /// </summary>
 /// <param name="renderer">The PDF renderer.</param>
 /// <param name="obj">The reference inline object to be renderered.</param>
 protected override void Write(PdfBuilder renderer, ReferenceInline obj)
 {
     renderer.AppendReference(obj.ReferenceName, TextStyle.Normal);
 }
コード例 #3
0
        public void TestUseCustomBibFile()
        {
            string reference = "custom_reference";

            AddCitation(reference);
            citationResolver.Setup(r => r.Lookup(It.IsNotIn <string>(reference))).Throws <NotImplementedException>();
            Assert.DoesNotThrow(() => builder.AppendReference(reference, TextStyle.Normal));
        }