diff --git a/src/ImageSharp/Common/Helpers/RuntimeEnvironment.cs b/src/ImageSharp/Common/Helpers/RuntimeEnvironment.cs deleted file mode 100644 index 925925ff9..000000000 --- a/src/ImageSharp/Common/Helpers/RuntimeEnvironment.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Six Labors. -// Licensed under the Six Labors Split License. - -using System; -using System.Runtime.InteropServices; - -namespace SixLabors.ImageSharp -{ - /// - /// Provides information about the .NET runtime installation. - /// Many methods defer to when available. - /// - internal static class RuntimeEnvironment - { - private static readonly Lazy IsNetCoreLazy = new Lazy(() => FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase)); - - /// - /// Gets a value indicating whether the .NET installation is .NET Core 3.1 or lower. - /// - public static bool IsNetCore => IsNetCoreLazy.Value; - - /// - /// Gets the name of the .NET installation on which an app is running. - /// - public static string FrameworkDescription => RuntimeInformation.FrameworkDescription; - - /// - /// Indicates whether the current application is running on the specified platform. - /// - public static bool IsOSPlatform(OSPlatform osPlatform) => RuntimeInformation.IsOSPlatform(osPlatform); - } -} diff --git a/tests/ImageSharp.Tests/Helpers/RuntimeEnvironmentTests.cs b/tests/ImageSharp.Tests/Helpers/RuntimeEnvironmentTests.cs deleted file mode 100644 index d61b8b86c..000000000 --- a/tests/ImageSharp.Tests/Helpers/RuntimeEnvironmentTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Six Labors. -// Licensed under the Six Labors Split License. - -using System.Runtime.InteropServices; -using Xunit; - -namespace SixLabors.ImageSharp.Tests.Helpers -{ - public class RuntimeEnvironmentTests - { - [Fact] - public void CanDetectNetCore() => Assert.False(RuntimeEnvironment.IsNetCore); - - [Fact] - public void CanDetectOSPlatform() - { - if (TestEnvironment.IsLinux) - { - Assert.True(RuntimeEnvironment.IsOSPlatform(OSPlatform.Linux)); - } - else if (TestEnvironment.IsMacOS) - { - Assert.True(RuntimeEnvironment.IsOSPlatform(OSPlatform.OSX)); - } - else if (TestEnvironment.IsWindows) - { - Assert.True(RuntimeEnvironment.IsOSPlatform(OSPlatform.Windows)); - } - } - } -}