PrivateObject Constructor (String, String, Type[], Object[])

Initializes a new instance of the PrivateObject class. This creates an object of the specified type and wraps it in the private object.

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

public PrivateObject(
	string assemblyName,
	string typeName,
	Type[] parameterTypes,
	Object[] args
)

Parameters

assemblyName
Type: String

Name of the assembly that contains the type.

typeName
Type: String

Fully qualified name of the type.

parameterTypes
Type: Type[]

An array of Type objects representing the number, order, and type of the parameters for constructing the object.

args
Type: Object[]

The arguments to define the object.

ExceptionCondition
ArgumentNullException

assemblyName or typeName is null.

ArgumentException

parameterTypes is multidimensional.

-or-

A constructor cannot be found to match the parameters specified in PrivateObject.

Show: