mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-20 20:07:57 +08:00
add negative test case and make tests non-lenient
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
{
|
||||
var file = GetFilename();
|
||||
|
||||
using (var document = PdfDocument.Open(File.ReadAllBytes(file)))
|
||||
using (var document = PdfDocument.Open(File.ReadAllBytes(file), ParsingOptions.LenientParsingOff))
|
||||
{
|
||||
Assert.Equal(1, document.NumberOfPages);
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
[Fact]
|
||||
public void HasCorrectPageSize()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename()))
|
||||
using (var document = PdfDocument.Open(GetFilename(), ParsingOptions.LenientParsingOff))
|
||||
{
|
||||
var page = document.GetPage(1);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
[Fact]
|
||||
public void HasCorrectLetterBoundingBoxes()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename()))
|
||||
using (var document = PdfDocument.Open(GetFilename(), ParsingOptions.LenientParsingOff))
|
||||
{
|
||||
var page = document.GetPage(1);
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
[Fact]
|
||||
public void GetsCorrectPageTextIgnoringHiddenCharacters()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename()))
|
||||
using (var document = PdfDocument.Open(GetFilename(), ParsingOptions.LenientParsingOff))
|
||||
{
|
||||
var page = document.GetPage(1);
|
||||
|
||||
@@ -81,5 +81,14 @@
|
||||
Assert.Equal("I am a simple pdf.", text);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TryGetBookmarksFalse()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename(), ParsingOptions.LenientParsingOff))
|
||||
{
|
||||
Assert.False(document.TryGetBookmarks(out _));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user