Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions QRCoderTests/SvgQRCodeRendererTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down