Skip to content

Commit 0e961b7

Browse files
committed
Use TestRuntime instead.
1 parent 960f7f6 commit 0e961b7

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

tests/Magick.NET.Tests/Coders/TheSvgCoder.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public void ShouldUseWidthAndHeightFromReadSettings()
8888
[Fact]
8989
public void ShouldReadFontsWithQuotes()
9090
{
91+
if (TestRuntime.HasFlakyMacOSResult)
92+
return;
93+
9194
var svg = @"<?xml version=""1.0"" encoding=""utf-8""?>
9295
<svg version=""1.1"" xmlns=""http://www.w3.org/2000/svg"" xmlns:xlink=""http://www.w3.org/1999/xlink"" viewBox=""0 0 220 80"">
9396
<style type=""text/css"">
@@ -105,9 +108,6 @@ public void ShouldReadFontsWithQuotes()
105108
Assert.Equal(220, image.Width);
106109
Assert.Equal(80, image.Height);
107110

108-
if (Runtime.IsMacOS)
109-
return;
110-
111111
ColorAssert.Equal(MagickColors.White, image, 118, 6);
112112
ColorAssert.Equal(MagickColors.Black, image, 120, 6);
113113
ColorAssert.Equal(MagickColors.Black, image, 141, 6);

tests/Magick.NET.Tests/Settings/MagickSettingsTests/TheFontProperty.cs

+10-11
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@ public class TheFontProperty
1313
[Fact]
1414
public void ShouldSetTheFontWhenReadingImage()
1515
{
16-
if (Runtime.IsMacOS)
16+
if (TestRuntime.HasFlakyMacOSResult)
1717
return;
1818

19-
using (var image = new MagickImage())
20-
{
21-
Assert.Null(image.Settings.Font);
19+
using var image = new MagickImage();
2220

23-
image.Settings.Font = "Courier New";
24-
image.Settings.FontPointsize = 40;
25-
image.Read("pango:Test");
21+
Assert.Null(image.Settings.Font);
2622

27-
Assert.Equal(128, image.Width);
28-
Assert.Contains(image.Height, new[] { 58, 62 });
29-
ColorAssert.Equal(MagickColors.Black, image, 26, 22);
30-
}
23+
image.Settings.Font = "Courier New";
24+
image.Settings.FontPointsize = 40;
25+
image.Read("pango:Test");
26+
27+
Assert.Equal(128, image.Width);
28+
Assert.Contains(image.Height, new[] { 58, 62 });
29+
ColorAssert.Equal(MagickColors.Black, image, 26, 22);
3130
}
3231
}
3332
}

tests/Magick.NET.Tests/TestHelpers/TestRuntime.cs

+3
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ internal static class TestRuntime
99
{
1010
public static bool HasFlakyLinuxArm64Result
1111
=> Runtime.IsLinux && Runtime.IsArm64;
12+
13+
public static bool HasFlakyMacOSResult
14+
=> Runtime.IsMacOS;
1215
}
1316
}

0 commit comments

Comments
 (0)