Skip to content

Commit 696bb39

Browse files
authored
Enable SVG tests (#654)
1 parent eccbd54 commit 696bb39

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

QRCoderTests/SvgQRCodeRendererTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void can_render_svg_qrcode_without_quietzones_hex()
6262
svg.ShouldMatchApproved(x => x.NoDiff().WithFileExtension("svg"));
6363
}
6464

65-
#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
65+
#if SYSTEM_DRAWING
6666
[Fact]
6767
public void can_render_svg_qrcode_with_png_logo_bitmap()
6868
{
@@ -83,7 +83,7 @@ public void can_render_svg_qrcode_with_png_logo_bitmap()
8383
RegexOptions.IgnoreCase);
8484
var match = regex.Match(svg);
8585
if (!match.Success || match.Groups.Count < 2)
86-
throw new Exception("Could not find embedded image data in SVG output.");
86+
throw new InvalidOperationException("Could not find embedded image data in SVG output.");
8787
var base64Data = match.Groups[1].Value;
8888
var imageData = Convert.FromBase64String(base64Data);
8989
imageData.ShouldMatchApprovedImage(discriminator: "embeddedLogo");
@@ -111,7 +111,7 @@ public void can_render_svg_qrcode_with_png_logo_bitmap_without_background()
111111
RegexOptions.IgnoreCase);
112112
var match = regex.Match(svg);
113113
if (!match.Success || match.Groups.Count < 2)
114-
throw new Exception("Could not find embedded image data in SVG output.");
114+
throw new InvalidOperationException("Could not find embedded image data in SVG output.");
115115
var base64Data = match.Groups[1].Value;
116116
var imageData = Convert.FromBase64String(base64Data);
117117
imageData.ShouldMatchApprovedImage(discriminator: "embeddedLogo");
@@ -139,7 +139,7 @@ public void can_render_svg_qrcode_with_png_logo_bitmap_without_quietzones()
139139
RegexOptions.IgnoreCase);
140140
var match = regex.Match(svg);
141141
if (!match.Success || match.Groups.Count < 2)
142-
throw new Exception("Could not find embedded image data in SVG output.");
142+
throw new InvalidOperationException("Could not find embedded image data in SVG output.");
143143
var base64Data = match.Groups[1].Value;
144144
var imageData = Convert.FromBase64String(base64Data);
145145
imageData.ShouldMatchApprovedImage(discriminator: "embeddedLogo");

0 commit comments

Comments
 (0)