public virtual void MakeObjectIndirectWhileFontIsDirectTest() { PdfFontUnitTest.TestFont font = new PdfFontUnitTest.TestFont(); PdfDictionary dictionary = new PdfDictionary(); NUnit.Framework.Assert.IsFalse(font.MakeObjectIndirect(dictionary)); NUnit.Framework.Assert.IsNull(dictionary.GetIndirectReference()); }
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()); } }