ClassCleanupAttribute Constructor ()
Initializes a new instance of the ClassCleanupAttribute class.
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Legacy Code Example
The following examples demonstrate the initialization and clean-up attributes used to indicate which methods should be run by the test engine at different periods of the test.
The first code samples contain a class and method to test. To run this example, create a class library project and replace the code with the following example.
The following example contains code to test DivideMethod() found in the previous code examples. Create a test project and put the following code in a test class document. Add the appropriate references to the project. This code contains attributes that control the initialization and clean-up execution order for the method, class, and assembly.
In particular, note the ClassCleanup attribute on the ClassCleanup()method.