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.

ClassInitializeAttribute Constructor ()

 

Initializes a new instance of the ClassInitializeAttribute class.

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

public:
ClassInitializeAttribute()

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.

No code example is currently available or this language may not be supported.

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 ClassInitialize attribute on the ClassInit()method.

No code example is currently available or this language may not be supported.
Return to top
Show: