Aracılığıyla paylaş


PrivateObject Members

Include Protected Members
Include Inherited Members

Allows test code to call methods and properties on the code under test that would be inaccessible because they are not public.

The PrivateObject type exposes the following members.

Constructors

 

Name

Description

Public method

PrivateObject

Overloaded. Initializes a new instance of the PrivateObject class.

Top

Methods

 

Name

Description

Public method

Equals

Returns a value that indicates whether two private objects are encapsulating the same target object. (Overrides Object.Equals(Object).)

Protected method

Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)

Public method

GetArrayElement

Overloaded. Gets the array element using an array of subscripts for each dimension.

Public method

GetField

Overloaded. Gets the value of the wrapped field.

Public method

GetFieldOrProperty

Overloaded. Gets a value of a wrapped field or property.

Public method

GetHashCode

Gets the hash code of the wrapped object. (Overrides Object.GetHashCode().)

Public method

GetProperty

Overloaded. Gets the value of the property of the wrapped object.

Public method

GetType

Gets the type of the current instance. (Inherited from Object.)

Public method

Invoke

Overloaded. Used to access the members of the private object.

Protected method

MemberwiseClone

Creates a shallow copy of the current Object. (Inherited from Object.)

Public method

SetArrayElement

Overloaded. Sets the array element by using an array of subscripts for each dimension.

Public method

SetField

Overloaded. Sets the value of the field of the wrapped object.

Public method

SetFieldOrProperty

Overloaded. Sets a value of a wrapped field or property.

Public method

SetProperty

Overloaded. Sets the value of the property of the wrapped object.

Public method

ToString

Returns a string that represents the current object. (Inherited from Object.)

Top

Properties

 

Name

Description

Public property

RealType

Gets the type of the underlying object.

Public property

Target

Gets or sets the wrapped object.

Top

See Also

Reference

PrivateObject Class

Microsoft.VisualStudio.TestTools.UnitTesting Namespace