In Part 2 , we discussed about TestSetUp and TearDown. If notice TestSetUP and TearDown is related to tests. They both get executed each time a test get executed. So if there are 5 tests in Test Fixture then TestSetUp and TearDown will get executed 5 times. Sometime this is good and needed for certain requirements. However doing heavy tasks like cleaning up whole database etc. each time for a test may not be a good idea. You may want to perform certain task for whole test fixture than for each and individual tests.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Unit Testing,NUnit