Browse Source

Add test for Identify

pull/3096/head
Brian Popow 2 months ago
parent
commit
d121039956
  1. 12
      tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs

12
tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs

@ -13,6 +13,18 @@ public class ExrDecoderTests
{
private static MagickReferenceDecoder ReferenceDecoder => MagickReferenceDecoder.Exr;
[Theory]
[InlineData(TestImages.Exr.Uncompressed, 803, 1197)]
public void ExrDecoder_Identify_DetectsCorrectWidthAndHeight<TPixel>(string imagePath, int expectedWidth, int expectedHeight)
{
TestFile testFile = TestFile.Create(imagePath);
using MemoryStream stream = new(testFile.Bytes, false);
ImageInfo imageInfo = Image.Identify(stream);
Assert.NotNull(imageInfo);
Assert.Equal(expectedWidth, imageInfo.Width);
Assert.Equal(expectedHeight, imageInfo.Height);
}
[Theory]
[WithFile(TestImages.Exr.Uncompressed, PixelTypes.Rgba32)]
public void ExrDecoder_CanDecode_Uncompressed<TPixel>(TestImageProvider<TPixel> provider)

Loading…
Cancel
Save