Share via


PrivateObject.SetField Method (String, Object)

Sets a value for the field of the wrapped object, identified by name.

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

Syntax

'Declaration
Public Sub SetField ( _
    name As String, _
    value As Object _
)
public void SetField(
    string name,
    Object value
)
public:
void SetField(
    String^ name, 
    Object^ value
)
member SetField : 
        name:string * 
        value:Object -> unit
public function SetField(
    name : String, 
    value : Object
)

Parameters

  • name
    Type: String

    The name of the field to set a value.

  • value
    Type: Object

    The value to set.

Exceptions

Exception Condition
ArgumentException

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

.NET Framework Security

See Also

Reference

PrivateObject Class

SetField Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace