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)); }
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()); } }
public virtual void ConstructorWithoutParamsTest() { PdfFontUnitTest.TestFont font = new PdfFontUnitTest.TestFont(); NUnit.Framework.Assert.AreEqual(PdfName.Font, font.GetPdfObject().Get(PdfName.Type)); }