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: String

The name of the field to set a value.

bindingFlags
Type: BindingFlags
value
Type: Object

The value to set.

ExceptionCondition
ArgumentException

name is null or empty.

Show: