Table of Contents

Class OSPlatform

Namespace
NUnit.Framework.Internal
Assembly
nunit.framework.dll

OSPlatform represents a particular operating system platform

public class OSPlatform
Inheritance
OSPlatform
Inherited Members

Constructors

OSPlatform(PlatformID, Version)

Construct from a platform ID and version

public OSPlatform(PlatformID platform, Version version)

Parameters

platform PlatformID
version Version

OSPlatform(PlatformID, Version, ProductType)

Construct from a platform ID, version and product type

public OSPlatform(PlatformID platform, Version version, OSPlatform.ProductType product)

Parameters

platform PlatformID
version Version
product OSPlatform.ProductType

Fields

MacOSXPlatformID

Platform ID for MacOSX as defined by .NET and Mono

public static readonly PlatformID MacOSXPlatformID

Field Value

PlatformID

UnixPlatformIDMicrosoft

Platform ID for Unix as defined by .NET

public static readonly PlatformID UnixPlatformIDMicrosoft

Field Value

PlatformID

UnixPlatformIDMono

Platform ID for Unix as defined by Mono

public static readonly PlatformID UnixPlatformIDMono

Field Value

PlatformID

XBoxPlatformID

Platform ID for XBox as defined by .NET and Mono

public static readonly PlatformID XBoxPlatformID

Field Value

PlatformID

Properties

CurrentPlatform

Get the OSPlatform under which we are currently running

public static OSPlatform CurrentPlatform { get; }

Property Value

OSPlatform

IsMacOSX

Return true if the platform is MacOSX

public bool IsMacOSX { get; }

Property Value

bool

IsNT3

Return true if the platform is NT 3

public bool IsNT3 { get; }

Property Value

bool

IsNT4

Return true if the platform is NT 4

public bool IsNT4 { get; }

Property Value

bool

IsNT5

Return true if the platform is NT 5

public bool IsNT5 { get; }

Property Value

bool

IsNT6

Return true if the platform is NT 6

public bool IsNT6 { get; }

Property Value

bool

IsNT60

Return true if the platform is NT 6.0

public bool IsNT60 { get; }

Property Value

bool

IsNT61

Return true if the platform is NT 6.1

public bool IsNT61 { get; }

Property Value

bool

IsNT62

Return true if the platform is NT 6.2

public bool IsNT62 { get; }

Property Value

bool

IsNT63

Return true if the platform is NT 6.3

public bool IsNT63 { get; }

Property Value

bool

IsUnix

Return true if this is a Unix or Linux platform

public bool IsUnix { get; }

Property Value

bool

IsVista

Return true if the platform is Vista

public bool IsVista { get; }

Property Value

bool

IsWin2003Server

Return true if the platform is Windows 2003 Server

public bool IsWin2003Server { get; }

Property Value

bool

IsWin2008Server

Return true if the platform is Windows 2008 Server (original or R2)

public bool IsWin2008Server { get; }

Property Value

bool

IsWin2008ServerR1

Return true if the platform is Windows 2008 Server (original)

public bool IsWin2008ServerR1 { get; }

Property Value

bool

IsWin2008ServerR2

Return true if the platform is Windows 2008 Server R2

public bool IsWin2008ServerR2 { get; }

Property Value

bool

IsWin2012Server

Return true if the platform is Windows 2012 Server (original or R2)

public bool IsWin2012Server { get; }

Property Value

bool

IsWin2012ServerR1

Return true if the platform is Windows 2012 Server (original)

public bool IsWin2012ServerR1 { get; }

Property Value

bool

IsWin2012ServerR2

Return true if the platform is Windows 2012 Server R2

public bool IsWin2012ServerR2 { get; }

Property Value

bool

IsWin2K

Return true if the platform is Windows 2000

public bool IsWin2K { get; }

Property Value

bool

IsWin32NT

Return true if the platform is Win32NT

public bool IsWin32NT { get; }

Property Value

bool

IsWin32S

Return true if the platform is Win32S

public bool IsWin32S { get; }

Property Value

bool

IsWin32Windows

Return true if the platform is Win32Windows

public bool IsWin32Windows { get; }

Property Value

bool

IsWin95

Return true if the platform is Windows 95

public bool IsWin95 { get; }

Property Value

bool

IsWin98

Return true if the platform is Windows 98

public bool IsWin98 { get; }

Property Value

bool

IsWinCE

Return true if the platform is Windows CE

public bool IsWinCE { get; }

Property Value

bool

IsWinME

Return true if the platform is Windows ME

public bool IsWinME { get; }

Property Value

bool

IsWinXP

Return true if the platform is Windows XP

public bool IsWinXP { get; }

Property Value

bool

IsWindows

Return true if this is a windows platform

public bool IsWindows { get; }

Property Value

bool

IsWindows10

Return true if the platform is Windows 10

public bool IsWindows10 { get; }

Property Value

bool

IsWindows11

Return true if the platform is Windows 11

public bool IsWindows11 { get; }

Property Value

bool

IsWindows7

Return true if the platform is Windows 7

public bool IsWindows7 { get; }

Property Value

bool

IsWindows8

Return true if the platform is Windows 8

public bool IsWindows8 { get; }

Property Value

bool

IsWindows81

Return true if the platform is Windows 8.1

public bool IsWindows81 { get; }

Property Value

bool

IsWindowsServer10

Return true if the platform is Windows Server. This is named Windows Server 10 to distinguish it from previous versions of Windows Server.

public bool IsWindowsServer10 { get; }

Property Value

bool

IsXbox

Return true if the platform is Xbox

public bool IsXbox { get; }

Property Value

bool

OSDescription

Gets a description for the current OS.

public static string OSDescription { get; }

Property Value

string

Platform

Get the platform ID of this instance

public PlatformID Platform { get; }

Property Value

PlatformID

Product

Get the Product Type of this instance

public OSPlatform.ProductType Product { get; }

Property Value

OSPlatform.ProductType

Version

Get the Version of this instance

public Version Version { get; }

Property Value

Version

Methods

ToString()

Implemented to use in place of Environment.OSVersion.ToString()

public override string ToString()

Returns

string

A representation of the platform ID and version in an approximation of the format used by Environment.OSVersion.ToString()