Extends Verify to allow verification of documents via DocNet.
See Milestones for release notes. Converts pdf documents to png for verification.
Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.
[ModuleInitializer]publicstaticvoidInitialize(){VerifyDocNet.Initialize();// 0.95 tolerates cross-OS pdfium PNG rendering (default is 0.98).VerifierSettings.UseSsimForPng(0.95);}VerifyImageMagick.RegisterComparers (provided by https://github.com/VerifyTests/Verify.ImageMagick) allows minor image changes to be ignored.
[Test]publicTaskVerifyPdf()=>VerifyFile("sample.pdf");[Test]publicTaskVerifyPdfStream(){varstream=File.OpenRead("sample.pdf");returnVerify(stream,"pdf");}Samples.VerifyPdf#01.verified.png:
[Test]publicTaskVerifyPreserveTransparency()=>VerifyFile("sample.pdf").PreserveTransparency();[Test]publicTaskVerifyPageDimensions()=>VerifyFile("sample.pdf").PageDimensions(new(1080,1920));[Test]publicTaskVerifyFirstPage(){varstream=File.OpenRead("sample.pdf");returnVerify(stream,"pdf").SinglePage(0);}[Test]publicTaskVerifySecondPage(){varstream=File.OpenRead("sample.pdf");returnVerify(stream,"pdf").SinglePage(1);}Pdf designed by Alfredo from The Noun Project.


