Charlie Mott

  Home  |   Contact  |   Syndication    |   Login
  20 Posts | 0 Stories | 20 Comments | 0 Trackbacks


View Charlie Mott's profile on LinkedIn

Article Categories


Image Galleries

Wednesday, August 8, 2012 #

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: