mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 19:05:01 +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
|
||||
{
|
||||
get
|
||||
|
Reference in New Issue
Block a user