共用方式為


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)

Syntax

'Declaration
Public Function GetField ( _
    name As String _
) As Object
public Object GetField(
    string name
)
public:
Object^ GetField(
    String^ name
)
member GetField : 
        name:string -> Object
public function GetField(
    name : String
) : Object

Parameters

  • name
    Type: String

    The name of the private field to get.

Return Value

Type: Object
The value set for the name field.

Exceptions

Exception Condition
ArgumentException

name is nulla null reference (Nothing in Visual Basic) or empty.

.NET Framework Security

See Also

Reference

PrivateObject Class

GetField Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace