Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)

public void SetField(
	string name,
	BindingFlags bindingFlags,
	object value
)

Parameters

name
Type: System.String

The name of the field to set a value.

invokeAttr

A bitmask comprised of one or more BindingFlags that specifies how the search for the field is conducted. The type of lookup need not be specified. The default value is SetField. If null is used, the default value is passed. Additional flags will be added to the mask.

value
Type: System.Object

The value to set.

Exception Condition
ArgumentException

name is null or empty.

Return to top
Show: