Share via


PrivateObject Constructor (Object, PrivateType)

Initializes a new instance of the PrivateObject class that creates the wrapper for the specified object.

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

Syntax

'Declaration
Public Sub New ( _
    obj As Object, _
    type As PrivateType _
)
public PrivateObject(
    Object obj,
    PrivateType type
)
public:
PrivateObject(
    Object^ obj, 
    PrivateType^ type
)
new : 
        obj:Object * 
        type:PrivateType -> PrivateObject
public function PrivateObject(
    obj : Object, 
    type : PrivateType
)

Parameters

  • obj
    Type: Object

    The object to wrap.

Exceptions

Exception Condition
ArgumentNullException

type is nulla null reference (Nothing in Visual Basic)

Remarks

The following table shows initial property values for an instance of the PrivateObject class that is instantiated with PrivateObject .

Property

Value

Target

obj

RealType

The wrapped object type

.NET Framework Security

See Also

Reference

PrivateObject Class

PrivateObject Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace