Skip to content
Prev Previous commit
Next Next commit
add more tests
  • Loading branch information
adamsitnik committed Jul 10, 2020
commit 2d2ed3e5eaedbf6b20717d055c0ae0c33d0eea6e
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,54 @@ public void CheckOSX()
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.watchOS));
}

[Fact, PlatformSpecific(TestPlatforms.Android)]
public void CheckAndroid()
{
Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.Android));

Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.macOS));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Browser));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.iOS));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.tvOS));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.watchOS));
}

[Fact, PlatformSpecific(TestPlatforms.tvOS)]
public void Check_tvOS()
{
Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.tvOS));

Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.macOS));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Browser));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Android));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.iOS));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.watchOS));
}

[Fact, PlatformSpecific(TestPlatforms.iOS)]
public void Check_iOS()
{
Assert.True(RuntimeInformation.IsOSPlatform(OSPlatform.iOS));

Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.OSX));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.macOS));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Linux));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Browser));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Android));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.tvOS));
Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.watchOS));
}

[Fact, PlatformSpecific(TestPlatforms.Windows)] // Tests RuntimeInformation OS platform
public void CheckWindows()
{
Expand Down