Skip to content

Repository files navigation

Verify.DocNet

DiscussionsBuild statusNuGet Status

Extends Verify to allow verification of documents via DocNet.

See Milestones for release notes. Converts pdf documents to png for verification.

Sponsors

Entity Framework Extensions

Entity Framework Extensions is a major sponsor and is proud to contribute to the development this project.

Entity Framework Extensions

Developed using JetBrains IDEs

JetBrains logo.

NuGet

Usage

Enable Verify.DocNet

[ModuleInitializer]publicstaticvoidInitialize(){VerifyDocNet.Initialize();// 0.95 tolerates cross-OS pdfium PNG rendering (default is 0.98).VerifierSettings.UseSsimForPng(0.95);}

snippet source | anchor

VerifyImageMagick.RegisterComparers (provided by https://github.com/VerifyTests/Verify.ImageMagick) allows minor image changes to be ignored.

Verify a file

[Test]publicTaskVerifyPdf()=>VerifyFile("sample.pdf");

snippet source | anchor

Verify a Stream

[Test]publicTaskVerifyPdfStream(){varstream=File.OpenRead("sample.pdf");returnVerify(stream,"pdf");}

snippet source | anchor

Result

Samples.VerifyPdf#01.verified.png:

PreserveTransparency

[Test]publicTaskVerifyPreserveTransparency()=>VerifyFile("sample.pdf").PreserveTransparency();

snippet source | anchor

PageDimensions

[Test]publicTaskVerifyPageDimensions()=>VerifyFile("sample.pdf").PageDimensions(new(1080,1920));

snippet source | anchor

VerifySinglePage

[Test]publicTaskVerifyFirstPage(){varstream=File.OpenRead("sample.pdf");returnVerify(stream,"pdf").SinglePage(0);}[Test]publicTaskVerifySecondPage(){varstream=File.OpenRead("sample.pdf");returnVerify(stream,"pdf").SinglePage(1);}

snippet source | anchor

File Samples

http://file-examples.com/

Icon

Pdf designed by Alfredo from The Noun Project.

About

Extends Verify to allow verification of documents via DocNet.

Resources

Code of conduct

Stars

11 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages