Charlie Mott

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

News

View Charlie Mott's profile on LinkedIn



Archives

Post Categories

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:  http://social.msdn.microsoft.com/Forums/sa/vsautotest/thread/d95523f9-1b74-4daa-bfc3-c393c1ef6c15

posted on Wednesday, August 8, 2012 10:27 PM