Click to Rate and Give Feedback
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Team Test API
PrivateObject Class

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

Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in microsoft.visualstudio.qualitytools.unittestframework.dll)

Visual Basic (Declaration)
Public Class PrivateObject
Visual Basic (Usage)
Dim instance As PrivateObject
C#
public class PrivateObject
C++
public ref class PrivateObject
J#
public class PrivateObject
JScript
public class PrivateObject

The test generator creates most of the calls to these objects. The test generator creates code to wrap the private objects in a wrapper that allows access to the private object's members.

For a list of initial property values for an instance of the PrivateObject class, see the PrivateObject constructor.

This class represents the live non-public internal object in the system.

System.Object
  Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker