IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.Internal.PlatformHelper Class Reference

PlatformHelper class is used by the PlatformAttribute class to determine whether a platform is supported. More...

+ Collaboration diagram for NUnit.Framework.Internal.PlatformHelper:

Public Member Functions

 PlatformHelper ()
 Default constructor uses the operating system and common language runtime of the system. More...
 
 PlatformHelper (OSPlatform os, RuntimeFramework rt)
 Construct a PlatformHelper for a particular operating system and common language runtime. Used in testing. More...
 
bool IsPlatformSupported (string[] platforms)
 Test to determine if one of a collection of platforms is being used currently. More...
 
bool IsPlatformSupported (PlatformAttribute platformAttribute)
 Tests to determine if the current platform is supported based on a platform attribute. More...
 
bool IsPlatformSupported (TestCaseAttribute testCaseAttribute)
 Tests to determine if the current platform is supported based on a platform attribute. More...
 
bool IsPlatformSupported (string platform)
 Test to determine if the a particular platform or comma- delimited set of platforms is in use. More...
 

Public Attributes

const string OSPlatforms = CommonOSPlatforms + ",Xbox,MacOSX"
 Comma-delimited list of all supported OS platform constants More...
 

Static Public Attributes

static readonly string RuntimePlatforms
 Comma-delimited list of all supported Runtime platform constants More...
 

Properties

string Reason [get]
 Return the last failure reason. Results are not defined if called before IsSupported( Attribute ) is called. More...
 

Private Member Functions

bool IsPlatformSupported (string include, string exclude)
 
bool IsRuntimeSupported (string platformName)
 
bool IsRuntimeSupported (RuntimeType runtime, string versionSpecification)
 

Private Attributes

OSPlatform os
 
RuntimeFramework rt
 
string reason = string.Empty
 
const string CommonOSPlatforms
 

Detailed Description

PlatformHelper class is used by the PlatformAttribute class to determine whether a platform is supported.

Constructor & Destructor Documentation

NUnit.Framework.Internal.PlatformHelper.PlatformHelper ( )
inline

Default constructor uses the operating system and common language runtime of the system.

References NUnit.Framework.Internal.RuntimeFramework.CurrentFramework, and NUnit.Framework.Internal.OSPlatform.CurrentPlatform.

NUnit.Framework.Internal.PlatformHelper.PlatformHelper ( OSPlatform  os,
RuntimeFramework  rt 
)
inline

Construct a PlatformHelper for a particular operating system and common language runtime. Used in testing.

Parameters
osOperatingSystem to be used
rtRuntimeFramework to be used

Member Function Documentation

bool NUnit.Framework.Internal.PlatformHelper.IsPlatformSupported ( string[]  platforms)
inline

Test to determine if one of a collection of platforms is being used currently.

Parameters
platforms
Returns

Referenced by NUnit.Framework.PlatformAttribute.ApplyToTest(), NUnit.Framework.TestCaseAttribute.BuildFrom(), and NUnit.Framework.Internal.PlatformDetectionTests.PlatformAttribute_ProcessBitNess().

bool NUnit.Framework.Internal.PlatformHelper.IsPlatformSupported ( PlatformAttribute  platformAttribute)
inline

Tests to determine if the current platform is supported based on a platform attribute.

Parameters
platformAttributeThe attribute to examine
Returns

References NUnit.Framework.IncludeExcludeAttribute.Exclude, and NUnit.Framework.IncludeExcludeAttribute.Include.

bool NUnit.Framework.Internal.PlatformHelper.IsPlatformSupported ( TestCaseAttribute  testCaseAttribute)
inline

Tests to determine if the current platform is supported based on a platform attribute.

Parameters
testCaseAttributeThe attribute to examine
Returns

References NUnit.Framework.TestCaseAttribute.ExcludePlatform, and NUnit.Framework.TestCaseAttribute.IncludePlatform.

bool NUnit.Framework.Internal.PlatformHelper.IsPlatformSupported ( string  include,
string  exclude 
)
inlineprivate
bool NUnit.Framework.Internal.PlatformHelper.IsPlatformSupported ( string  platform)
inline

Test to determine if the a particular platform or comma- delimited set of platforms is in use.

Parameters
platformName of the platform or comma-separated list of platform ids
Returns
True if the platform is in use on the system

References NUnit.Framework.Internal.OSPlatform.IsMacOSX, NUnit.Framework.Internal.OSPlatform.IsNT3, NUnit.Framework.Internal.OSPlatform.IsNT4, NUnit.Framework.Internal.OSPlatform.IsNT5, NUnit.Framework.Internal.OSPlatform.IsNT6, NUnit.Framework.Internal.OSPlatform.IsUnix, NUnit.Framework.Internal.OSPlatform.IsVista, NUnit.Framework.Internal.OSPlatform.IsWin2003Server, NUnit.Framework.Internal.OSPlatform.IsWin2008Server, NUnit.Framework.Internal.OSPlatform.IsWin2008ServerR2, NUnit.Framework.Internal.OSPlatform.IsWin2012ServerR1, NUnit.Framework.Internal.OSPlatform.IsWin2012ServerR2, NUnit.Framework.Internal.OSPlatform.IsWin2K, NUnit.Framework.Internal.OSPlatform.IsWin32NT, NUnit.Framework.Internal.OSPlatform.IsWin32S, NUnit.Framework.Internal.OSPlatform.IsWin32Windows, NUnit.Framework.Internal.OSPlatform.IsWin95, NUnit.Framework.Internal.OSPlatform.IsWin98, NUnit.Framework.Internal.OSPlatform.IsWinCE, NUnit.Framework.Internal.OSPlatform.IsWindows, NUnit.Framework.Internal.OSPlatform.IsWindows10, NUnit.Framework.Internal.OSPlatform.IsWindows7, NUnit.Framework.Internal.OSPlatform.IsWindows8, NUnit.Framework.Internal.OSPlatform.IsWindows81, NUnit.Framework.Internal.OSPlatform.IsWindowsServer10, NUnit.Framework.Internal.OSPlatform.IsWinME, NUnit.Framework.Internal.OSPlatform.IsWinXP, and NUnit.Framework.Internal.OSPlatform.IsXbox.

bool NUnit.Framework.Internal.PlatformHelper.IsRuntimeSupported ( string  platformName)
inlineprivate
bool NUnit.Framework.Internal.PlatformHelper.IsRuntimeSupported ( RuntimeType  runtime,
string  versionSpecification 
)
inlineprivate

Member Data Documentation

OSPlatform NUnit.Framework.Internal.PlatformHelper.os
private
RuntimeFramework NUnit.Framework.Internal.PlatformHelper.rt
private
string NUnit.Framework.Internal.PlatformHelper.reason = string.Empty
private
const string NUnit.Framework.Internal.PlatformHelper.CommonOSPlatforms
private
Initial value:
=
"Win,Win32,Win32S,Win32NT,Win32Windows,WinCE,Win95,Win98,WinMe,NT3,NT4,NT5,NT6," +
"Win2008Server,Win2008ServerR2,Win2012Server,Win2012ServerR2," +
"Win2K,WinXP,Win2003Server,Vista,Win7,Windows7,Win8,Windows8,"+
"Win8.1,Windows8.1,Win10,Windows10,WindowsServer10,Unix,Linux"
const string NUnit.Framework.Internal.PlatformHelper.OSPlatforms = CommonOSPlatforms + ",Xbox,MacOSX"

Comma-delimited list of all supported OS platform constants

Referenced by NUnit.Framework.Internal.PlatformDetectionTests.CheckOSPlatforms().

readonly string NUnit.Framework.Internal.PlatformHelper.RuntimePlatforms
static
Initial value:
=
"Net,NetCF,SSCLI,Rotor,Mono,MonoTouch"

Comma-delimited list of all supported Runtime platform constants

Referenced by NUnit.Framework.Internal.PlatformDetectionTests.CheckRuntimePlatforms().

Property Documentation

string NUnit.Framework.Internal.PlatformHelper.Reason
get

Return the last failure reason. Results are not defined if called before IsSupported( Attribute ) is called.

Referenced by NUnit.Framework.PlatformAttribute.ApplyToTest(), and NUnit.Framework.TestCaseAttribute.BuildFrom().


The documentation for this class was generated from the following file: