Add MacOsX and Xbox to platform attribute
This commit is contained in:
Родитель
6d852f0fba
Коммит
5c7cb5dedb
|
@ -21,7 +21,11 @@ namespace NUnit.Core
|
|||
/// Comma-delimited list of all supported OS platform constants
|
||||
/// </summary>
|
||||
public static readonly string OSPlatforms =
|
||||
#if CLR_2_0 || CLR_4_0
|
||||
"Win,Win32,Win32S,Win32NT,Win32Windows,WinCE,Win95,Win98,WinMe,NT3,NT4,NT5,NT6,Win2K,WinXP,Win2003Server,Vista,Win2008Server,Win2008ServerR2,Win2012Server,Windows7,Windows8,Unix,Linux,Xbox,MacOSX";
|
||||
#else
|
||||
"Win,Win32,Win32S,Win32NT,Win32Windows,WinCE,Win95,Win98,WinMe,NT3,NT4,NT5,NT6,Win2K,WinXP,Win2003Server,Vista,Win2008Server,Win2008ServerR2,Win2012Server,Windows7,Windows8,Unix,Linux";
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Comma-delimited list of all supported Runtime platform constants
|
||||
|
@ -198,6 +202,14 @@ namespace NUnit.Core
|
|||
case "LINUX":
|
||||
isSupported = os.IsUnix;
|
||||
break;
|
||||
#if (CLR_2_0 || CLR_4_0) && !NETCF
|
||||
case "XBOX":
|
||||
isSupported = os.IsXbox;
|
||||
break;
|
||||
case "MACOSX":
|
||||
isSupported = os.IsMacOSX;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
isSupported = IsRuntimeSupported(platformName);
|
||||
|
|
|
@ -206,6 +206,24 @@ namespace NUnit.Core
|
|||
get { return (int)platform == 3; } // PlatformID.WinCE not defined in .NET 1.0
|
||||
}
|
||||
|
||||
#if (CLR_2_0 || CLR_4_0) && !NETCF
|
||||
/// <summary>
|
||||
/// Return true if the platform is Xbox
|
||||
/// </summary>
|
||||
public bool IsXbox
|
||||
{
|
||||
get { return platform == PlatformID.Xbox; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the platform is MacOSX
|
||||
/// </summary>
|
||||
public bool IsMacOSX
|
||||
{
|
||||
get { return platform == PlatformID.MacOSX; }
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the platform is Windows 95
|
||||
/// </summary>
|
||||
|
|
|
@ -199,6 +199,24 @@ namespace NUnit.Core.Tests
|
|||
"UNIX,Linux");
|
||||
}
|
||||
|
||||
#if (CLR_2_0 || CLR_4_0) && !NETCF
|
||||
[Test]
|
||||
public void DetectXbox()
|
||||
{
|
||||
CheckOSPlatforms(
|
||||
new OSPlatform(PlatformID.Xbox, new Version(0, 0)),
|
||||
"Xbox");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DetectMacOSX()
|
||||
{
|
||||
CheckOSPlatforms(
|
||||
new OSPlatform(PlatformID.MacOSX, new Version(0, 0)),
|
||||
"MacOSX");
|
||||
}
|
||||
#endif
|
||||
|
||||
[Test]
|
||||
public void DetectNet10()
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче