PrivateObject.SetProperty Method (String, BindingFlags, Object, Object[])

Sets a property for a wrapped object identified by name with binding flags.

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

public void SetProperty(
	string name,
	BindingFlags bindingFlags,
	Object value,
	params Object[] args
)

Parameters

name
Type: String

The name of property to invoke.

bindingFlags
Type: BindingFlags
value
Type: Object

The value to set the property identified by name.

args
Type: Object[]

An array that contains the arguments to pass to the property to invoke.

ExceptionCondition
ArgumentException

name is null or empty.

Show: