Skip to content

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

License

Notifications You must be signed in to change notification settings

fake-image-generator/FakeImageGenerator.MSTest

Repository files navigation

FakeImageGenerator.MSTest

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.MSTest

Usage

Add the FakeImageGeneratorAttribute in all MSTest data tests in which you need fake images like this:

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

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

[DataTestMethod]
[FakeImageGeneratorAttribute(10000000, "Png")]
public void GenerateFakeImageWithoutOutputPathShouldBeOk(byte[] array)
{
    Assert.AreEqual(10000000, array.Length);
}

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages