diff --git a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs index de1c47d417..c29f8c5891 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs @@ -302,11 +302,10 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png public void Decode_InvalidDataChunkCrc_ThrowsException(TestImageProvider provider) where TPixel : unmanaged, IPixel { - Exception ex = Record.Exception( + InvalidImageContentException ex = Assert.Throws( () => { using Image image = provider.GetImage(PngDecoder); - image.DebugSave(provider); }); Assert.NotNull(ex); Assert.Contains("CRC Error. PNG IDAT chunk is corrupt!", ex.Message);