Skip to content

Extends Verify to allow verification of documents via ImageSharp.

License

Notifications You must be signed in to change notification settings

VerifyTests/Verify.ImageSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verify.ImageSharp

Discussions Build status NuGet Status

Extends Verify to allow verification of documents via ImageSharp.

See Milestones for release notes.

NuGet package

https://nuget.org/packages/Verify.ImageSharp/

Usage

[ModuleInitializer]
public static void Init() =>
    VerifyImageSharp.Initialize();

snippet source | anchor

Verify a file

[Test]
public Task VerifyImageFile() =>
    VerifyFile("sample.jpg");

snippet source | anchor

[Test]
public Task VerifyImageFileWithCustomEncoder() =>
    VerifyFile("sample.jpg")
        .EncodeAsPng();

snippet source | anchor

Two files are produced

Info file:

Samples.VerifyImageFile.verified.txt

{
  Width: 1599,
  Height: 1066,
  HorizontalResolution: 1.0,
  VerticalResolution: 1.0
}

snippet source | anchor

Image file:

Samples.VerifyImageFile.verified.jpg

Verify an SixLabors.ImageSharp.Image

An instance if an SixLabors.ImageSharp.Image can be verified using the following:

[Test]
public Task VerifyImage()
{
    var image = new Image<Rgba32>(11, 11)
    {
        [5, 5] = Rgba32.ParseHex("#0000FF")
    };
    return Verify(image);
}

snippet source | anchor

File Samples

http://file-examples.com/

Icon

Swirl designed by BÖCK, RU from The Noun Project.

About

Extends Verify to allow verification of documents via ImageSharp.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Languages