From 1d36bb139e050ada6738e91c5fce567d12fb9ffb Mon Sep 17 00:00:00 2001 From: Shane Krueger Date: Tue, 7 Oct 2025 18:46:46 -0400 Subject: [PATCH] Enable SVG tests --- QRCoderTests/SvgQRCodeRendererTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/QRCoderTests/SvgQRCodeRendererTests.cs b/QRCoderTests/SvgQRCodeRendererTests.cs index 43346cf3..174ed6ba 100644 --- a/QRCoderTests/SvgQRCodeRendererTests.cs +++ b/QRCoderTests/SvgQRCodeRendererTests.cs @@ -62,7 +62,7 @@ public void can_render_svg_qrcode_without_quietzones_hex() svg.ShouldMatchApproved(x => x.NoDiff().WithFileExtension("svg")); } -#if SYSTEM_DRAWING && !NET5_0_OR_GREATER // .NET 5+ does not encode PNG images in a deterministic way, so the hash may be different across different runs +#if SYSTEM_DRAWING [Fact] public void can_render_svg_qrcode_with_png_logo_bitmap() { @@ -83,7 +83,7 @@ public void can_render_svg_qrcode_with_png_logo_bitmap() RegexOptions.IgnoreCase); var match = regex.Match(svg); if (!match.Success || match.Groups.Count < 2) - throw new Exception("Could not find embedded image data in SVG output."); + throw new InvalidOperationException("Could not find embedded image data in SVG output."); var base64Data = match.Groups[1].Value; var imageData = Convert.FromBase64String(base64Data); imageData.ShouldMatchApprovedImage(discriminator: "embeddedLogo"); @@ -111,7 +111,7 @@ public void can_render_svg_qrcode_with_png_logo_bitmap_without_background() RegexOptions.IgnoreCase); var match = regex.Match(svg); if (!match.Success || match.Groups.Count < 2) - throw new Exception("Could not find embedded image data in SVG output."); + throw new InvalidOperationException("Could not find embedded image data in SVG output."); var base64Data = match.Groups[1].Value; var imageData = Convert.FromBase64String(base64Data); imageData.ShouldMatchApprovedImage(discriminator: "embeddedLogo"); @@ -139,7 +139,7 @@ public void can_render_svg_qrcode_with_png_logo_bitmap_without_quietzones() RegexOptions.IgnoreCase); var match = regex.Match(svg); if (!match.Success || match.Groups.Count < 2) - throw new Exception("Could not find embedded image data in SVG output."); + throw new InvalidOperationException("Could not find embedded image data in SVG output."); var base64Data = match.Groups[1].Value; var imageData = Convert.FromBase64String(base64Data); imageData.ShouldMatchApprovedImage(discriminator: "embeddedLogo");