共用方式為


PrivateObject 建構函式 (Type, array<Type[], array<Object[])

初始化 PrivateObject 類別的新執行個體。

命名空間:  Microsoft.VisualStudio.TestTools.UnitTesting
組件:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

語法

'宣告
Public Sub New ( _
    type As Type, _
    parameterTypes As Type(), _
    args As Object() _
)
public PrivateObject(
    Type type,
    Type[] parameterTypes,
    Object[] args
)
public:
PrivateObject(
    Type^ type, 
    array<Type^>^ parameterTypes, 
    array<Object^>^ args
)
new : 
        type:Type * 
        parameterTypes:Type[] * 
        args:Object[] -> PrivateObject
public function PrivateObject(
    type : Type, 
    parameterTypes : Type[], 
    args : Object[]
)

參數

  • type
    類型:Type

    包裝的物件型別。

  • parameterTypes
    類型:array<Type[]

    Type 物件的陣列,表示用來建構物件之參數的數目、順序和型別。

  • args
    類型:array<Object[]

    用來定義物件的引數。

例外狀況

例外狀況 條件
ArgumentNullException

type 為 nullnull 參考 (即 Visual Basic 中的 Nothing)。

ArgumentException

parameterTypes 為多維。

-或-

找不到符合 PrivateObject 中指定之參數的建構函式。

備註

這可從傳遞的 type、parameterTypes 和 args 等參數建立物件。

.NET Framework 安全性

請參閱

參考

PrivateObject 類別

PrivateObject 多載

Microsoft.VisualStudio.TestTools.UnitTesting 命名空間