PrivateObject.SetField Method (String, BindingFlags, 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, _
bindingFlags As BindingFlags, _
value As Object _
)
public void SetField(
string name,
BindingFlags bindingFlags,
Object value
)
public:
void SetField(
String^ name,
BindingFlags bindingFlags,
Object^ value
)
member SetField :
name:string *
bindingFlags:BindingFlags *
value:Object -> unit
public function SetField(
name : String,
bindingFlags : BindingFlags,
value : Object
)
Parameters
name
Type: StringThe name of the field to set a value.
- bindingFlags
Type: BindingFlags
value
Type: ObjectThe 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.