Team Test API
Microsoft.VisualStudio.TestTools.UnitTesting Namespace

The Microsoft.VisualStudio.TestTools.UnitTesting namespace supplies classes that provide unit testing support. This namespace contains many attributes that identify test information to the test engine regarding data sources, order of method execution, program management, agent/host information, and deployment data. The Microsoft.VisualStudio.TestTools.UnitTesting namespace also contains custom unit testing exceptions.

To read a walkthrough of the unit test framework, go to the MSDN Library and search for the following article, "A Unit Testing Walkthrough with Visual Studio Team Test".

Classes

  ClassDescription
ms244252.pubclass(en-us,VS.90).gifAssemblyCleanupAttribute Identifies a method that contains code to be used after all tests in the assembly have run and to free resources obtained by the assembly. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifAssemblyInitializeAttribute Identifies a method that contains code to be used before all tests in the assembly have run and to allocate resources obtained by the assembly. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifAssert Verifies conditions in unit tests using true/false propositions.
ms244252.pubclass(en-us,VS.90).gifAssertFailedException Used to indicate failure for a test.
ms244252.pubclass(en-us,VS.90).gifAssertInconclusiveException Used to indicate that a test is not yet implemented.
ms244252.pubclass(en-us,VS.90).gifBaseShadow This class is used by the publicize method to help you test private types.
ms244252.pubclass(en-us,VS.90).gifClassCleanupAttribute Identifies a method that contains code to be used after all the tests in the test class have run and to free resources obtained by the test class. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifClassInitializeAttribute Identifies a method that contains code that must be used before any of the tests in the test class have run and to allocate resources to be used by the test class. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifCollectionAssert Verifies true/false propositions associated with collections in unit tests.
ms244252.pubclass(en-us,VS.90).gifCssIterationAttribute Represents the project iteration to which this test corresponds. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifCssProjectStructureAttribute Represents the node in the team project hierarchy to which this test corresponds.
ms244252.pubclass(en-us,VS.90).gifDataSourceAttribute Provides data source-specific information for data-driven testing. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifDataSourceElement Represents a data source element as an XML tag within a configuration file.
ms244252.pubclass(en-us,VS.90).gifDataSourceElementCollection Represents an XML element that contains a collection of child DataSourceElement objects.
ms244252.pubclass(en-us,VS.90).gifDeploymentItemAttribute Used to specify deployment items such as files or directories for per-test deployment. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifDescriptionAttribute Used to specify the description of the test. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifExpectedExceptionAttribute Indicates that an exception is expected during test method execution. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifGenericParameterHelper This class is a placeholder for use with generics. It helps you test generic types by letting you pass non-specific type arguments.
ms244252.pubclass(en-us,VS.90).gifHostTypeAttribute Used to specify the type of host that this unit test will run in. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifIgnoreAttribute Indicates that a specific test should not be run. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifInternalTestFailureException The exception that is thrown to indicate an internal failure for a test.
ms244252.pubclass(en-us,VS.90).gifOwnerAttribute Used to specify the person responsible for maintaining, running, and/or debugging the test. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifPriorityAttribute Used to specify the priority of a unit test. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifPrivateObject Allows test code to call methods and properties on the code under test that would be inaccessible because they are not public.
ms244252.pubclass(en-us,VS.90).gifPrivateType Represents the type of a private class that gives access to private static implementations.
ms244252.pubclass(en-us,VS.90).gifShadowingAttribute Do not use this class.
ms244252.pubclass(en-us,VS.90).gifStringAssert Verifies true/false propositions associated with strings in unit tests.
ms244252.pubclass(en-us,VS.90).gifTestClassAttribute Used to identify classes that contain test methods. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifTestCleanupAttribute Identifies a method that contains code that must be used after the test has run and to free resources obtained by all the tests in the test class. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifTestConfiguration Provides access to a TestConfigurationSection that represents the microsoft.visualstudio.testtools section in an app.config file.
ms244252.pubclass(en-us,VS.90).gifTestConfigurationSection Provides access to data source configuration data.
ms244252.pubclass(en-us,VS.90).gifTestContext Used to store information that is provided to unit tests.
ms244252.pubclass(en-us,VS.90).gifTestInitializeAttribute Identifies the method to run before the test to allocate and configure resources needed by all tests in the test class. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifTestMethodAttribute Used to identify test methods. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifTestPropertyAttribute Establishes a test specific property on a method. This class cannot be inherited.
ms244252.pubclass(en-us,VS.90).gifTimeoutAttribute Used to specify the time-out period of a unit test.
ms244252.pubclass(en-us,VS.90).gifUnitTestAssertException This is the base class for unit test exceptions.
ms244252.pubclass(en-us,VS.90).gifWebServiceHelper Contains helper methods for Web service testing.
ms244252.pubclass(en-us,VS.90).gifWorkItemAttribute Used to specify a work item associated with a test.
Delegates

  DelegateDescription
ms244252.protdelegate(en-us,VS.90).gifBaseShadow..::.ElementConverter Do not use this delegate.
Enumerations

  EnumerationDescription
ms244252.pubenumeration(en-us,VS.90).gifDataAccessMethod Specifies constants that indicate how data rows are accessed in data-driven testing.
ms244252.pubenumeration(en-us,VS.90).gifUnitTestOutcome Use UnitTestOutcome to programmatically determine the outcome of a test that has run or is currently running.
See Also

Reference

Other Resources

Page view tracker