mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 03:34:52 +08:00
#10 test coverage for structure access
This commit is contained in:
@@ -26,6 +26,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData(nameof(GetAllDocuments))]
|
||||||
|
public void CanTokenizeAllAccessibleObjects(string documentName)
|
||||||
|
{
|
||||||
|
documentName = Path.Combine(DocumentFolder.Value, documentName);
|
||||||
|
|
||||||
|
using (var document = PdfDocument.Open(documentName, new ParsingOptions{ UseLenientParsing = false }))
|
||||||
|
{
|
||||||
|
Assert.NotNull(document.Structure.Catalog);
|
||||||
|
|
||||||
|
Assert.True(document.Structure.CrossReferenceTable.ObjectOffsets.Count > 0 , "Cross reference table was empty.");
|
||||||
|
foreach (var objectOffset in document.Structure.CrossReferenceTable.ObjectOffsets)
|
||||||
|
{
|
||||||
|
var token = document.Structure.GetObject(objectOffset.Key);
|
||||||
|
|
||||||
|
Assert.NotNull(token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<object[]> GetAllDocuments
|
public static IEnumerable<object[]> GetAllDocuments
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
Reference in New Issue
Block a user