共用方式為


PrivateObject Constructor (Object)

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 _
)
public PrivateObject(
    Object obj
)
public:
PrivateObject(
    Object^ obj
)
new : 
        obj:Object -> PrivateObject
public function PrivateObject(
    obj : Object
)

Parameters

  • obj
    Type: Object

    The object to wrap.

Exceptions

Exception Condition
ArgumentNullException

obj 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 Type of obj

.NET Framework Security

See Also

Reference

PrivateObject Class

PrivateObject Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace