Geeks With Blogs
Charlie Mott

This article discusses, from a BizTalk\BizUnit perspective, implementing the Channel Purger Enterprise Integration Patten to “keep 'left-over' messages on a channel from disturbing tests.”

If one test fails, you may see subsequent tests also fail.  This is because service instances triggered from the failed test may still be running in BizTalk.  These can then produce results that conflict with the expected results of these following tests. This could include: event log messages; files arriving in the target locations; suspended messages; etc. 

However, it takes a long time to run some clean-up operation steps such as: terminating running service instances; clearing target folders; etc.  You don’t want to do this after every successful test.

In MSTest, you can use the TestContext.CurrentTestOutcome property in a [TestCleanup] method to run these clean-up operations only when a test fails.  This post on the MSDN forum tell you how to use this property in this way:

Posted on Wednesday, August 8, 2012 10:27 PM BizTalk , BizUnit , MSTest | Back to top

Comments on this post: Clean-up BizTalk BizUnit tests only on failure

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © charlie.mott | Powered by: