PrivateObject Constructors

Definition

Overloads

PrivateObject(Object)

Initializes a new instance of the PrivateObject class that wraps the given object.

PrivateObject(Object, PrivateType)

Initializes a new instance of the PrivateObject class that wraps the given object.

PrivateObject(Object, String)

Initializes a new instance of the PrivateObject class that contains the already existing object of the private class

PrivateObject(Type, Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

PrivateObject(String, String, Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

PrivateObject(Type, Type[], Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

PrivateObject(String, String, Type[], Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

PrivateObject(Object)

Initializes a new instance of the PrivateObject class that wraps the given object.

public:
 PrivateObject(System::Object ^ obj);
public PrivateObject (object obj);
new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject : obj -> Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Public Sub New (obj As Object)

Parameters

obj
Object

object to wrap

Applies to

PrivateObject(Object, PrivateType)

Initializes a new instance of the PrivateObject class that wraps the given object.

public:
 PrivateObject(System::Object ^ obj, Microsoft::VisualStudio::TestTools::UnitTesting::PrivateType ^ type);
public PrivateObject (object obj, Microsoft.VisualStudio.TestTools.UnitTesting.PrivateType type);
new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject : obj * Microsoft.VisualStudio.TestTools.UnitTesting.PrivateType -> Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Public Sub New (obj As Object, type As PrivateType)

Parameters

obj
Object

object to wrap

type
PrivateType

PrivateType object

Applies to

PrivateObject(Object, String)

Initializes a new instance of the PrivateObject class that contains the already existing object of the private class

public:
 PrivateObject(System::Object ^ obj, System::String ^ memberToAccess);
public PrivateObject (object obj, string memberToAccess);
new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject : obj * string -> Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Public Sub New (obj As Object, memberToAccess As String)

Parameters

obj
Object

object that serves as starting point to reach the private members

memberToAccess
String

the de-referencing string using . that points to the object to be retrieved as in m_X.m_Y.m_Z

Applies to

PrivateObject(Type, Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

public:
 PrivateObject(Type ^ type, ... cli::array <System::Object ^> ^ args);
public PrivateObject (Type type, params object[] args);
new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject : Type * obj[] -> Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Public Sub New (type As Type, ParamArray args As Object())

Parameters

type
Type

type of the object to create

args
Object[]

Arguments to pass to the constructor

Applies to

PrivateObject(String, String, Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

public:
 PrivateObject(System::String ^ assemblyName, System::String ^ typeName, ... cli::array <System::Object ^> ^ args);
public PrivateObject (string assemblyName, string typeName, params object[] args);
new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject : string * string * obj[] -> Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Public Sub New (assemblyName As String, typeName As String, ParamArray args As Object())

Parameters

assemblyName
String

Name of the assembly

typeName
String

fully qualified name

args
Object[]

Arguments to pass to the constructor

Applies to

PrivateObject(Type, Type[], Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

public:
 PrivateObject(Type ^ type, cli::array <Type ^> ^ parameterTypes, cli::array <System::Object ^> ^ args);
public PrivateObject (Type type, Type[] parameterTypes, object[] args);
new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject : Type * Type[] * obj[] -> Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Public Sub New (type As Type, parameterTypes As Type(), args As Object())

Parameters

type
Type

type of the object to create

parameterTypes
Type[]

An array of Type objects representing the number, order, and type of the parameters for the constructor to get

args
Object[]

Arguments to pass to the constructor

Applies to

PrivateObject(String, String, Type[], Object[])

Initializes a new instance of the PrivateObject class that wraps the specified type.

public:
 PrivateObject(System::String ^ assemblyName, System::String ^ typeName, cli::array <Type ^> ^ parameterTypes, cli::array <System::Object ^> ^ args);
public PrivateObject (string assemblyName, string typeName, Type[] parameterTypes, object[] args);
new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject : string * string * Type[] * obj[] -> Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Public Sub New (assemblyName As String, typeName As String, parameterTypes As Type(), args As Object())

Parameters

assemblyName
String

Name of the assembly

typeName
String

fully qualified name

parameterTypes
Type[]

An array of Type objects representing the number, order, and type of the parameters for the constructor to get

args
Object[]

Arguments to pass to the constructor

Applies to