コード例 #1
0
        public virtual void ConstructorWithDictionaryTest()
        {
            PdfDictionary dictionary = new PdfDictionary();

            dictionary.Put(PdfName.A, PdfName.B);
            PdfFontUnitTest.TestFont font = new PdfFontUnitTest.TestFont(dictionary);
            NUnit.Framework.Assert.AreEqual(PdfName.Font, font.GetPdfObject().Get(PdfName.Type));
            NUnit.Framework.Assert.AreEqual(PdfName.B, font.GetPdfObject().Get(PdfName.A));
        }
コード例 #2
0
 public virtual void MakeObjectIndirectWhileFontIsIndirectTest()
 {
     using (PdfDocument document = new PdfDocument(new PdfWriter(new MemoryStream()))) {
         // to avoid an exception
         document.AddNewPage();
         PdfFontUnitTest.TestFont font = new PdfFontUnitTest.TestFont();
         font.GetPdfObject().MakeIndirect(document);
         PdfDictionary dictionary = new PdfDictionary();
         NUnit.Framework.Assert.IsTrue(font.MakeObjectIndirect(dictionary));
         NUnit.Framework.Assert.IsNotNull(dictionary.GetIndirectReference());
         NUnit.Framework.Assert.AreEqual(document, dictionary.GetIndirectReference().GetDocument());
     }
 }
コード例 #3
0
 public virtual void ConstructorWithoutParamsTest()
 {
     PdfFontUnitTest.TestFont font = new PdfFontUnitTest.TestFont();
     NUnit.Framework.Assert.AreEqual(PdfName.Font, font.GetPdfObject().Get(PdfName.Type));
 }