Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

For information on unit testing, see Verifying Code by Using Unit Tests.

  ClassDescription
Public classAfterAssemblyCleanupEventArgsProvides data for the AfterAssemblyCleanup event.
Public classAfterAssemblyInitializeEventArgsProvides data for the AfterAssemblyInitialize event.
Public classAfterClassCleanupEventArgsProvides data for the AfterClassCleanup event.
Public classAfterClassInitializeEventArgsProvides data for the AfterClassInitialize event.
Public classAfterTestCleanupEventArgsProvides data for the AfterTestCleanup event.
Public classAfterTestInitializeEventArgsProvides data for the AfterTestInitialize event.
Public classAssemblyCleanupAttributeIdentifies 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.
Public classAssemblyInitializeAttributeIdentifies 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.
Public classAssertVerifies conditions in unit tests using true/false propositions.
Public classAssertFailedExceptionUsed to indicate failure for a test.
Public classAssertInconclusiveExceptionUsed to indicate that a test is not yet implemented.
Public classBaseShadowThis class is used by the publicize method to help test private types.
Public classBeforeAssemblyCleanupEventArgsProvides data for the BeforeAssemblyCleanup event.
Public classBeforeAssemblyInitializeEventArgsProvides data for the BeforeAssemblyInitialize event.
Public classBeforeClassCleanupEventArgsProvides data for the BeforeClassCleanup event.
Public classBeforeClassInitializeEventArgsProvides data for the BeforeClassInitialize event.
Public classBeforeTestCleanupEventArgsProvides data for the BeforeTestCleanup event.
Public classBeforeTestInitializeEventArgsProvides data for the BeforeTestInitialize event.
Public classClassCleanupAttributeIdentifies 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.
Public classClassInitializeAttributeIdentifies 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.
Public classCollectionAssertVerifies true/false propositions associated with collections in unit tests.
Public classCssIterationAttributeRepresents the project iteration to which this test corresponds. This class cannot be inherited.
Public classCssProjectStructureAttributeRepresents the node in the team project hierarchy to which this test corresponds.
Public classDataSourceAttributeProvides data source-specific information for data-driven testing. This class cannot be inherited.
Public classDataSourceElementRepresents a data source element as an XML tag within a configuration file.
Public classDataSourceElementCollectionRepresents an XML element that contains a collection of child DataSourceElement objects.
Public classDeploymentItemAttributeUsed to specify deployment items such as files or directories for per-test deployment. This class cannot be inherited.
Public classDescriptionAttributeUsed to specify the description of the test. This class cannot be inherited.
Public classExpectedExceptionAttributeIndicates that an exception is expected during test method execution. This class cannot be inherited.
Public classExpectedExceptionBaseAttributeThis is a base class for attributes that specify to expect an exception from a unit test.
Public classGenericParameterHelperThis class is a placeholder for use with generics. It helps you test generic types by letting you pass non-specific type arguments.
Public classHostTypeAttributeSpecifies the type of host on which the associated unit test will run. This class cannot be inherited.
Public classIgnoreAttributeIndicates that a specific test should not be run. This class cannot be inherited.
Public classInternalTestFailureExceptionThe exception that is thrown to indicate an internal failure for a test.
Public classOnTestStoppingEventArgsOccurs when a test is stopped before it is completed.
Public classOwnerAttributeUsed to specify the person responsible for maintaining, running, and/or debugging the test. This class cannot be inherited.
Public classPriorityAttributeUsed to specify the priority of a unit test. This class cannot be inherited.
Public classPrivateObjectAllows test code to call methods and properties on the code under test that would be inaccessible because they are not public.
Public classPrivateTypeRepresents the type of a private class that gives access to private static implementations.
Public classShadowingAttributeDo not use this class.
Public classStringAssertVerifies true/false propositions associated with strings in unit tests.
Public classTestCategoryAttributeClass that is used to specify the category of a unit test.
Public classTestCategoryBaseAttributeProvides a base class for the Category attribute.
Public classTestClassAttributeUsed to identify classes that contain test methods. This class cannot be inherited.
Public classTestClassExtensionAttributeActivates a class so that it is recognized as a Unit Test extension class.
Public classTestCleanupAttributeIdentifies 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.
Public classTestConfigurationProvides access to a TestConfigurationSection that represents the microsoft.visualstudio.testtools section in an app.config file.
Public classTestConfigurationSectionProvides access to data source configuration data.
Public classTestContextUsed to store information that is provided to unit tests.
Public classTestExecutionThis class represents events that are related to test execution.
Public classTestExecutionEventArgsBase class for events in the TestExecution class.
Public classTestExtensionExecutionThis class enables the customized execution of tests.
Public classTestInitializeAttributeIdentifies 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.
Public classTestMethodAttributeUsed to identify test methods. This class cannot be inherited.
Public classTestMethodInvokerContextPassed to the Unit Test Adapter to the TestExtensionExecution.CreateMethodInvoker.
Public classTestMethodInvokerResultThe result that is returned by Invoke().
Public classTestPropertyAttributeEstablishes a test specific property on a method. This class cannot be inherited.
Public classTimeoutAttributeUsed to specify the time-out period of a unit test.
Public classUnitTestAssertExceptionThis is the base class for unit test exceptions.
Public classWebServiceHelperContains helper methods for Web service testing.
Public classWorkItemAttributeUsed to specify a work item associated with a test.

  InterfaceDescription
Public interfaceITestMethodInvokerInterface to invoke the test method body.

  DelegateDescription
Protected delegateBaseShadow.ElementConverterDelegate used for deep copying of arrays. Converts the source element of an array into the target element.

  EnumerationDescription
Public enumerationDataAccessMethodSpecifies constants that indicate how data rows are accessed in data-driven testing.
Public enumerationTestTimeoutEnumeration for time-outs that can be used with the TimeoutAttribute class.
Public enumerationUnitTestOutcomeUse UnitTestOutcome to programmatically determine the outcome of a test that has run or is currently running.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft