make color types public and add stream based tests to prevent future breaking as observed in #52

This commit is contained in:
Eliot Jones
2019-08-13 20:48:22 +01:00
parent fc2d532b82
commit f55091f3d2
5 changed files with 128 additions and 5 deletions

View File

@@ -28,6 +28,27 @@
}
}
[Theory]
[MemberData(nameof(GetAllDocuments))]
public void CanUseStreamForFirstPage(string documentName)
{
// Add the full path back on, we removed it so we could see it in the test explorer.
documentName = Path.Combine(DocumentFolder.Value, documentName);
var bytes = File.ReadAllBytes(documentName);
using (var memoryStream = new MemoryStream(bytes))
using (var document = PdfDocument.Open(memoryStream, new ParsingOptions { UseLenientParsing = false }))
{
for (var i = 0; i < document.NumberOfPages; i++)
{
var page = document.GetPage(i + 1);
Assert.NotNull(page.ExperimentalAccess.GetAnnotations().ToList());
}
}
}
[Theory]
[MemberData(nameof(GetAllDocuments))]
public void CanTokenizeAllAccessibleObjects(string documentName)