다음을 통해 공유


PrivateObject Constructor (Type, array<Type[], array<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)

Syntax

'Declaration
Public Sub New ( _
    type As Type, _
    parameterTypes As Type(), _
    args As Object() _
)
public PrivateObject(
    Type type,
    Type[] parameterTypes,
    Object[] args
)
public:
PrivateObject(
    Type^ type, 
    array<Type^>^ parameterTypes, 
    array<Object^>^ args
)
new : 
        type:Type * 
        parameterTypes:Type[] * 
        args:Object[] -> PrivateObject
public function PrivateObject(
    type : Type, 
    parameterTypes : Type[], 
    args : Object[]
)

Parameters

  • type
    Type: Type

    The wrapped object type.

  • parameterTypes
    Type: array<Type[]

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

  • args
    Type: array<Object[]

    The arguments to define the object.

Exceptions

Exception Condition
ArgumentNullException

type is nulla null reference (Nothing in Visual Basic).

ArgumentException

parameterTypes is multidimensional.

-or-

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

Remarks

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

.NET Framework Security

See Also

Reference

PrivateObject Class

PrivateObject Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace