private PdfName BuildLongName() { int maxAllowedLength = pdfA1Checker.GetMaxNameLength(); int testLength = maxAllowedLength + 1; NUnit.Framework.Assert.AreEqual(128, testLength); return(PdfACheckerTestUtils.GetLongName(testLength)); }
public virtual void ValidObjectsTest() { int maxNameLength = pdfA1Checker.GetMaxNameLength(); int maxStringLength = pdfA1Checker.GetMaxStringLength(); int maxArrayCapacity = MAX_ARRAY_CAPACITY; int maxDictionaryCapacity = MAX_DICTIONARY_CAPACITY; long maxIntegerValue = pdfA1Checker.GetMaxIntegerValue(); long minIntegerValue = pdfA1Checker.GetMinIntegerValue(); double maxRealValue = pdfA1Checker.GetMaxRealValue(); NUnit.Framework.Assert.AreEqual(65535, maxStringLength); NUnit.Framework.Assert.AreEqual(127, maxNameLength); PdfString longString = PdfACheckerTestUtils.GetLongString(maxStringLength); PdfName longName = PdfACheckerTestUtils.GetLongName(maxNameLength); PdfArray longArray = PdfACheckerTestUtils.GetLongArray(maxArrayCapacity); PdfDictionary longDictionary = PdfACheckerTestUtils.GetLongDictionary(maxDictionaryCapacity); NUnit.Framework.Assert.AreEqual(2147483647, maxIntegerValue); NUnit.Framework.Assert.AreEqual(-2147483648, minIntegerValue); NUnit.Framework.Assert.AreEqual(32767, maxRealValue, 0.001); PdfNumber largeInteger = new PdfNumber(maxIntegerValue); PdfNumber negativeInteger = new PdfNumber(minIntegerValue); PdfNumber largeReal = new PdfNumber(maxRealValue - 0.001); PdfObject[] largeObjects = new PdfObject[] { longName, longString, longArray, longDictionary, largeInteger , negativeInteger, largeReal }; // No exceptions should not be thrown as all values match the // limitations provided in specification foreach (PdfObject largeObject in largeObjects) { pdfA1Checker.CheckPdfObject(largeObject); CheckInArray(largeObject); CheckInDictionary(largeObject); CheckInComplexStructure(largeObject); CheckInContentStream(largeObject); CheckInArrayInContentStream(largeObject); CheckInDictionaryInContentStream(largeObject); CheckInFormXObject(largeObject); CheckInTilingPattern(largeObject); CheckInType3Font(largeObject); } }