Skip to content

Commit 6a99e4f

Browse files
committed
Also use a static constructor in the TestRuntime.
1 parent d936238 commit 6a99e4f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ namespace Magick.NET.Tests;
88

99
internal static class TestRuntime
1010
{
11-
public static bool HasFlakyLinuxArm64Result { get; } = IsLinux && Runtime.Architecture is Architecture.Arm64;
11+
static TestRuntime()
12+
{
13+
HasFlakyLinuxArm64Result = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && Runtime.Architecture is Architecture.Arm64;
14+
HasFlakyMacOSResult = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
15+
HasFlakyMacOSArm64Result = HasFlakyMacOSResult && Runtime.Architecture == Architecture.Arm64;
16+
}
1217

13-
public static bool HasFlakyMacOSResult { get; } = IsMacOS;
18+
public static bool HasFlakyLinuxArm64Result { get; }
1419

15-
public static bool HasFlakyMacOSArm64Result { get; } = IsMacOS && Runtime.Architecture is Architecture.Arm64;
20+
public static bool HasFlakyMacOSResult { get; }
1621

17-
private static bool IsLinux { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
22+
public static bool HasFlakyMacOSArm64Result { get; }
1823

19-
private static bool IsMacOS { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
24+
private static bool IsMacOS { get; }
2025
}

0 commit comments

Comments
 (0)