PrivateObject Constructor (Type^, array<Object^>^)
Initializes a new instance of the PrivateObject class that creates the wrapper for the specified object.
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Parameters
- type
-
Type:
System::Type^
The wrapped object type.
- args
-
Type:
array<System::Object^>^
The arguments to define the object.
| Exception | Condition |
|---|---|
| ArgumentNullException | type is null. |
| ArgumentException | type is not a RuntimeType. |
| NotSupportedException | type cannot be a TypeBuilder. -or- Creation of TypedReference, ArgIterator, and RuntimeArgumentHandle types is not supported. |
| TargetInvocationException | The constructor being called throws an exception. |
| COMException | type is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered. |
| TypeLoadException | type is not a valid type. |
| MissingMethodException | No matching public constructor was found to match the type and args. |
An object is created by using the type and args.
The following table shows initial property values for an instance of the PrivateObject class instantiated with PrivateObject.
Property | Value |
|---|---|
The object created from type and args. | |
The wrapped object type |