PrivateObject.SetFieldOrProperty Method (String, Object)

Sets a value of a wrapped field or property based on the name.

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

Syntax

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

Parameters

  • name
    Type: String

    The name of the private field or property to set.

  • value
    Type: Object

    The value to set for name.

Remarks

Important

This is important for Visual Basic source code as fields and properties are used the same way.

.NET Framework Security

See Also

Reference

PrivateObject Class

SetFieldOrProperty Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace