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: System.Object
The object to wrap.
- type
Type: Microsoft.VisualStudio.TestTools.UnitTesting.PrivateType
The wrapped object type.
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 |
---|---|
obj |
|
The wrapped object type |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.