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.

TestInitializeAttribute Constructor ()

 

Initializes a new instance of the TestInitializeAttribute class.

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

public:
TestInitializeAttribute()

Legacy Code Example

The SampleClassLib namespace contains the DivideClass class, which in turn contains the method we want to test. This method is called DivideMethod().

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

In the following code, the DivideClassTest test class contains a test method called DivideMethodTest. This code also contains attributes that control the initialization and clean-up run order for the method, class, and assembly.

In particular, note the TestInitialize attribute on the Initialize() method.

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