We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

PrivateObject.GetField Method (String)

Gets a value from a named field, based on the name.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

public Object GetField(
	string name
)

Parameters

name
Type: String

The name of the private field to get.

Return Value

Type: Object
The value set for the name field.

ExceptionCondition
ArgumentException

name is null or empty.

Show: