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

Syntax

'Declaration
Public Sub New ( _
    assemblyName As String, _
    typeName As String, _
    parameterTypes As Type(), _
    args As Object() _
)
'Usage
Dim assemblyName As String 
Dim typeName As String 
Dim parameterTypes As Type()
Dim args As Object()

Dim instance As New PrivateObject(assemblyName, _
    typeName, parameterTypes, args)
public PrivateObject(
    string assemblyName,
    string typeName,
    Type[] parameterTypes,
    Object[] args
)
public:
PrivateObject(
    String^ assemblyName, 
    String^ typeName, 
    array<Type^>^ parameterTypes, 
    array<Object^>^ args
)
public function PrivateObject(
    assemblyName : String, 
    typeName : String, 
    parameterTypes : Type[], 
    args : Object[]
)

Parameters

  • assemblyName
    Type: System.String

    Name of the assembly that contains the type.

  • parameterTypes
    Type: array<System.Type[]

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

  • args
    Type: array<System.Object[]

    The arguments to define the object.

Exceptions

Exception Condition
ArgumentNullException

assemblyName or typeName 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

Smart Device Developer Notes

The Device Unit Test Framework (Microsoft.VisualStudio.SmartDevice.UnitTestFramework.dll) version of this method does not support calls where parameterTypes is null and args is non-null.

.NET Framework Security

See Also

Reference

PrivateObject Class

PrivateObject Members

PrivateObject Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace