Browse Source

Removed unused class.

pull/2189/head
Dirk Lemstra 3 years ago
parent
commit
3a6f26d136
No known key found for this signature in database GPG Key ID: 40B84DE7D6271D30
  1. 32
      src/ImageSharp/Common/Helpers/RuntimeEnvironment.cs
  2. 31
      tests/ImageSharp.Tests/Helpers/RuntimeEnvironmentTests.cs

32
src/ImageSharp/Common/Helpers/RuntimeEnvironment.cs

@ -1,32 +0,0 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System;
using System.Runtime.InteropServices;
namespace SixLabors.ImageSharp
{
/// <summary>
/// Provides information about the .NET runtime installation.
/// Many methods defer to <see cref="RuntimeInformation"/> when available.
/// </summary>
internal static class RuntimeEnvironment
{
private static readonly Lazy<bool> IsNetCoreLazy = new Lazy<bool>(() => FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase));
/// <summary>
/// Gets a value indicating whether the .NET installation is .NET Core 3.1 or lower.
/// </summary>
public static bool IsNetCore => IsNetCoreLazy.Value;
/// <summary>
/// Gets the name of the .NET installation on which an app is running.
/// </summary>
public static string FrameworkDescription => RuntimeInformation.FrameworkDescription;
/// <summary>
/// Indicates whether the current application is running on the specified platform.
/// </summary>
public static bool IsOSPlatform(OSPlatform osPlatform) => RuntimeInformation.IsOSPlatform(osPlatform);
}
}

31
tests/ImageSharp.Tests/Helpers/RuntimeEnvironmentTests.cs

@ -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));
}
}
}
}
Loading…
Cancel
Save