Dela via


BaseShadow Class

This class is used by the publicize method to help test private types.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.TestTools.UnitTesting.BaseShadow

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

'Declaration
Public Class BaseShadow
public class BaseShadow
public ref class BaseShadow
type BaseShadow =  class end
public class BaseShadow

The BaseShadow type exposes the following members.

Constructors

  Name Description
Protected method BaseShadow(PrivateObject) Initializes a new instance of the BaseShadow class.
Protected method BaseShadow(PrivateType) Initializes a new instance of the BaseShadow class.

Top

Properties

  Name Description
Public property Target Gets the target object.

Top

Methods

  Name Description
Public method Equals Determines whether the specified Object is equal to the current 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 GetHashCode Returns the hash code for this instance. (Overrides Object.GetHashCode().)
Protected methodStatic member GetShadowAttacher Used for dynamically restoring of arrays of private types.
Protected methodStatic member GetTargetObject Static function that will be used with TransferArray for deep array copy with unshadowing the real target Type objects.
Protected methodStatic member GetTargetType Returns the target Type for a potential shadow class.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public methodStatic member MakeArrayType Returns a Type object that represents an array of the specified type, with the specified number of dimensions.
Public methodStatic member MakeByRefType Returns a Type object that represents the specified type when it is passed as a ref parameter.
Public methodStatic member MakePointerType Returns a Type object that represents a pointer to the specified type.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodStatic member Same Dummy method used to transfer the arrays of the same Type. This is the failsafe implementation of the BaseShadow.ElementConverter delegate used for arrays of the same type.
Public method ToString Returns a String that represents the current BaseShadow object. (Overrides Object.ToString().)
Protected methodStatic member TransferArray Performs a deep copy of an array of one Type into a similar array of different Type.

Top

Fields

  Name Description
Public fieldStatic member AttachShadowName The name of the static method in derived classes.
Protected field m_privateObject The PrivateObject stored in this instance.

Top

Remarks

Public Type accessors that use the PrivateObject class to test private types must inherit from this class.

Use this as a base class to inherit from. Do not call the methods of this class directly.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.TestTools.UnitTesting Namespace