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: System.String
The name of the field to set a value.
- value
Type: System.Object
The value to set.
Exceptions
Exception | Condition |
---|---|
ArgumentException | name is nulla null reference (Nothing in Visual Basic) or empty. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.