mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
// ReSharper disable InconsistentNaming
|
|
namespace ImageSharp.Tests
|
|
{
|
|
using System;
|
|
|
|
using ImageSharp.PixelFormats;
|
|
|
|
using Xunit;
|
|
|
|
public class TestImageExtensionsTests
|
|
{
|
|
[Theory]
|
|
[WithSolidFilledImages(10, 10, 0, 0, 255, PixelTypes.Rgba32)]
|
|
public void CompareToReferenceOutput_WhenReferenceOutputMatches_ShouldNotThrow<TPixel>(
|
|
TestImageProvider<TPixel> provider)
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
using (Image<TPixel> image = provider.GetImage())
|
|
{
|
|
image.CompareToReferenceOutput(provider);
|
|
}
|
|
}
|
|
|
|
[Theory]
|
|
[WithSolidFilledImages(10, 10, 0, 0, 255, PixelTypes.Rgba32)]
|
|
public void CompareToReferenceOutput_WhenReferenceOutputDoesNotMatch_Throws<TPixel>(
|
|
TestImageProvider<TPixel> provider)
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
using (Image<TPixel> image = provider.GetImage())
|
|
{
|
|
Assert.ThrowsAny<Exception>(() => image.CompareToReferenceOutput(provider));
|
|
}
|
|
}
|
|
|
|
[Theory]
|
|
[WithSolidFilledImages(10, 10, 0, 0, 255, PixelTypes.Rgba32)]
|
|
public void CompareToReferenceOutput_WhenReferenceFileMissing_Throws<TPixel>(TestImageProvider<TPixel> provider)
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
using (Image<TPixel> image = provider.GetImage())
|
|
{
|
|
Assert.ThrowsAny<Exception>(() => image.CompareToReferenceOutput(provider));
|
|
}
|
|
}
|
|
}
|
|
}
|