{
private readonly object _dummy;
private readonly int _dummyPrimitive;
+ public static System.Runtime.InteropServices.OSPlatform Android { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Browser { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform FreeBSD { get { throw null; } }
+ public static System.Runtime.InteropServices.OSPlatform iOS { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Linux { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform OSX { get { throw null; } }
+ public static System.Runtime.InteropServices.OSPlatform tvOS { get { throw null; } }
+ public static System.Runtime.InteropServices.OSPlatform watchOS { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Windows { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Create(string osPlatform) { throw null; }
public override bool Equals(object? obj) { throw null; }
}
public static partial class RuntimeInformation
{
- public static string RuntimeIdentifier { get { throw null; } }
public static string FrameworkDescription { get { throw null; } }
public static System.Runtime.InteropServices.Architecture OSArchitecture { get { throw null; } }
public static string OSDescription { get { throw null; } }
public static System.Runtime.InteropServices.Architecture ProcessArchitecture { get { throw null; } }
+ public static string RuntimeIdentifier { get { throw null; } }
public static bool IsOSPlatform(System.Runtime.InteropServices.OSPlatform osPlatform) { throw null; }
}
}
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
}
+ [Fact, PlatformSpecific(TestPlatforms.iOS)] // Tests RuntimeInformation OS platform
+ public void CheckiOS()
+ {
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.iOS));
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")));
+
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("osx")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("mac")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACOSX")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
+ }
+
+ [Fact, PlatformSpecific(TestPlatforms.tvOS)] // Tests RuntimeInformation OS platform
+ public void ChecktvOS()
+ {
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.tvOS));
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")));
+
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("osx")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("mac")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACOSX")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
+ }
+
+ [Fact, PlatformSpecific(TestPlatforms.Android)] // Tests RuntimeInformation OS platform
+ public void CheckAndroid()
+ {
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Android));
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")));
+
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("osx")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("mac")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACOSX")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
+ }
+
+ [Fact, PlatformSpecific(TestPlatforms.Browser)] // Tests RuntimeInformation OS platform
+ public void CheckBrowser()
+ {
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Browser));
+ Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")));
+
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("NetBSD")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("netbsd")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("osx")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("mac")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("DARWIN")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACOSX")));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
+ Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
+ }
+
[Fact, PlatformSpecific(TestPlatforms.Windows)] // Tests RuntimeInformation OS platform
public void CheckWindows()
{