Table of Contents

Class RuntimeFramework

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

RuntimeFramework represents a particular version of a common language runtime implementation.

public sealed class RuntimeFramework
Inheritance
RuntimeFramework
Inherited Members

Constructors

RuntimeFramework(RuntimeType, Version)

Construct from a runtime type and version. If the version has two parts, it is taken as a framework version. If it has three or more, it is taken as a CLR version. In either case, the other version is deduced based on the runtime type and provided version.

public RuntimeFramework(RuntimeType runtime, Version version)

Parameters

runtime RuntimeType

The runtime type of the framework

version Version

The version of the framework

Fields

DefaultVersion

DefaultVersion is an empty Version, used to indicate that NUnit should select the CLR version to use for the test.

public static readonly Version DefaultVersion

Field Value

Version

Properties

AllowAnyVersion

Return true if any CLR version may be used in matching this RuntimeFramework object.

public bool AllowAnyVersion { get; }

Property Value

bool

ClrVersion

The CLR version for this runtime framework

public Version ClrVersion { get; }

Property Value

Version

CurrentFramework

Static method to return a RuntimeFramework object for the framework that is currently in use.

public static RuntimeFramework CurrentFramework { get; }

Property Value

RuntimeFramework

DisplayName

Returns the Display name for this framework

public string DisplayName { get; }

Property Value

string

FrameworkVersion

The framework version for this runtime framework

public Version FrameworkVersion { get; }

Property Value

Version

Runtime

The type of this runtime framework

public RuntimeType Runtime { get; }

Property Value

RuntimeType

Methods

Parse(string)

Parses a string representing a RuntimeFramework. The string may be just a RuntimeType name or just a Version or a hyphentated RuntimeType-Version or a Version prefixed by 'versionString'.

public static RuntimeFramework Parse(string s)

Parameters

s string

Returns

RuntimeFramework

Supports(RuntimeFramework)

Returns true if the current framework matches the one supplied as an argument. Two frameworks match if their runtime types are the same or either one is RuntimeType.Any and all specified version components are equal. Negative (i.e. unspecified) version components are ignored.

public bool Supports(RuntimeFramework target)

Parameters

target RuntimeFramework

The RuntimeFramework to be matched.

Returns

bool

True on match, otherwise false

ToString()

Overridden to return the short name of the framework

public override string ToString()

Returns

string