Extends Verify to allow verification of documents via QuestPDF.
Designed to help assert the output of projects using QuestPDF to generate PDFs.
https://nuget.org/packages/Verify.QuestPDF/
Enable:
public static class ModuleInitializer
{
[ModuleInitializer]
public static void Init() =>
VerifyQuestPdf.Initialize();
}
static IDocument GenerateDocument() =>
Document.Create(container =>
{
container.Page(page =>
{
page.Size(PageSizes.A5);
page.Margin(1, Unit.Centimetre);
page.PageColor(Colors.Grey.Lighten3);
page.DefaultTextStyle(x => x.FontSize(20));
page.Header()
.Text("Hello PDF!")
.SemiBold().FontSize(36);
page.Content()
.Column(x =>
{
x.Item()
.Text(Placeholders.LoremIpsum());
});
page.Footer()
.AlignCenter()
.Text(x =>
{
x.Span("Page ");
x.CurrentPageNumber();
});
});
});
[Test]
public Task VerifyDocument()
{
var document = GenerateDocument();
return Verify(document);
}
{
Pages: 1,
Metadata: {
CreationDate: DateTime_1,
ModifiedDate: DateTime_2,
ImageQuality: 101,
PdfA: false,
RasterDpi: 72
}
}