mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
[ADD] adding non regression unit test to cover PR 473
This commit is contained in:
parent
9c9c7c99ea
commit
998e768bba
Binary file not shown.
@ -0,0 +1,54 @@
|
||||
namespace UglyToad.PdfPig.Tests.Integration;
|
||||
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
|
||||
public class IndexedPageSummaryFileTests
|
||||
{
|
||||
private static string GetFilename()
|
||||
{
|
||||
return IntegrationHelpers.GetDocumentPath("FICTIF_TABLE_INDEX.pdf");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HasCorrectNumberOfPages()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename()))
|
||||
{
|
||||
Assert.Equal(14, document.NumberOfPages);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetPagesWorks()
|
||||
{
|
||||
using (var document = PdfDocument.Open(GetFilename()))
|
||||
{
|
||||
var pageCount = document.GetPages().Count();
|
||||
|
||||
Assert.Equal(14, pageCount);
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("M. HERNANDEZ DANIEL", 1)]
|
||||
[InlineData("M. HERNANDEZ DANIEL", 2)]
|
||||
[InlineData("Mme ALIBERT CHLOE AA", 3)]
|
||||
[InlineData("Mme ALIBERT CHLOE AA", 4)]
|
||||
[InlineData("M. SIMPSON BART AAA", 5)]
|
||||
[InlineData("M. SIMPSON BART AAA", 6)]
|
||||
[InlineData("M. BOND JAMES A", 7)]
|
||||
[InlineData("M. BOND JAMES A", 8)]
|
||||
[InlineData("M. DE BALZAC HONORE", 9)]
|
||||
[InlineData("M. DE BALZAC HONORE", 10)]
|
||||
[InlineData("M. STALLONE SILVESTER", 11)]
|
||||
[InlineData("M. STALLONE SILVESTER", 12)]
|
||||
[InlineData("M. SCOTT MICHAEL", 13)]
|
||||
[InlineData("M. SCOTT MICHAEL", 14)]
|
||||
public void CheckSpecificNamesPresence_InIndexedPageNumbersFile(string searchedName, int pageNumber)
|
||||
{
|
||||
using var document = PdfDocument.Open(GetFilename());
|
||||
var page = document.GetPage(pageNumber);
|
||||
Assert.Contains(searchedName, page.Text);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user