Congratulations, you've installed DasBlog!#

Be sure to visit all the options under "Configuration" in the Admin Menu Bar above. There are 16 themes to choose from, and you can also create your own.

 

Wednesday, July 20, 2005 2:00:00 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Team Test Attributes#

A quick breakdown of the Team Test attributes compared to NUnit attributes with a few examples.

All Team Test attributes are found in the following namespace:
Microsoft.VisualStudio.QualityTools.UnitTesting.Framework

Attribute Quick List

Team Test NUnit
TestClass TestFixture
AssemblyInitialize N/A
AssemblyCleanup N/A
ClassInitialize TestFixtureSetUp
ClassCleanup TestFixtureTearDown
TestInitialize SetUp
TestCleanup TearDown
TestMethod Test

AssemblyInitalize and AssemblyCleanup are new. There are no equivalent attributes in NUnit. These attributes run at AppDomain load and dispose.

[ AssemblyInitialize ]
public static void AssemblyInitialize()
{ }


[ AssemblyCleanup ]
public static void AssemblyCleanup()
{ }

Acting just like the NUnit TestFixtureSetUp and TestFixtureTearDown with the only one minor difference. Both methods have to be static and the ClassInitialize takes in one parameter. ClassInitialize will execute before any TestInitialize and TestMethod after the AssemblyInitialize while ClassCleanup executes after the TestMethod and TestCleanup but before the AssemblyCleanup.

[ ClassInitialize ]
public static void ClassInitialize(TestContext t)
{ }


[ ClassCleanup ]
public static void ClassCleanup()
{ }

TestInitialize executes before each test and TestCleanup executes after each test for every TestMethod.

[ TestInitialize ]
public void TestInitalize()
{ }


[ TestCleanup ]
public void TestCleanup()
{ }


 

Tuesday, July 05, 2005 10:05:35 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

All content © 2010, Clark Sell
On this page
This site
Calendar
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: