Skip to content

fake-image-generator/FakeImageGenerator.Xunit

Repository files navigation

FakeImageGenerator.Xunit

NuGet Github Actions

For more details about this project please check the main repository in FakeImageGenerator.

Requirements

.NET Core 3.1

Installation

Install-Package FakeImageGenerator.Xunit

Usage

Add the FakeImageGeneratorDataAttribute in all Xunit theories in which you need fake images like this:

[Theory]
[FakeImageGeneratorDataAttribute(10000000, "Png", "C:/")]
public void GenerateFakeImageWithOutputPathShouldBeOk(string path)
{
    var file = new FileInfo(path);

    Assert.Equal(10000000, file.Length);
    Assert.Equal(".png", file.Extension);
}

[Theory]
[FakeImageGeneratorDataAttribute(10000000, "Png")]
public void GenerateFakeImageWithoutOutputPathShouldBeOk(byte[] array)
{
    Assert.Equal(10000000, array.Length);
}

About

Generate a fake JPG or PNG image in any size between 1 KB and 2 GB for Xunit tests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages