This documentation is archived and is not being maintained.

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

Initializes a new instance of the PrivateObject class.

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

public PrivateObject(
	Type type,
	Type[] parameterTypes,
	Object[] args
)

Parameters

type
Type: Type

The wrapped object 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

type is null.

ArgumentException

parameterTypes is multidimensional.

-or-

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

This creates an object from the passed type, parameterTypes, and args parameters.

Show: