mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
870 B
31 lines
870 B
// 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));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|