Geeks With Blogs
Charlie Mott

Article Source:

Often it is handy to organise BizUnit tests into test lists. This way longer running tests and edge case tests can be removed from check-in builds keep them running a bit more quickly. However, updating a .vsmdi test lists for each individual test method is time consuming.

A better solution is to use the new Category attribute that comes with MSTest in .NET4 (nUnit  has supported a categories feature for a while).  In the TFS build processes, the mstest command line can make use of the /category flag. The check-in build will run tests categorised as Happy Flow. A Full build (nightly build) will run the lot. (Note, it is possible to do specify multiple categories).

In my solution, I have created constants for the followoing categories:

(e.g tests where we just fire messages through biztalk without checking the results.)
Acme.TestCategory.UseCase.AlternativeFlow (e.g. fault scenarios)


So a sample test method with these attributes would be as follows.  Notice the multiple target systems.

/// <summary>
/// Test valid Tax Codes message from Dynamics AX
/// </summary>
[TestTimer(5, 0)]
public void DynamicsAx_TaxCodes_Valid_Success()

Note: For details of the TestTimer attribute, see here. This is also a handy feature for BizUnit tests to validate performance.

Posted on Friday, April 1, 2011 10:06 AM BizTalk , BizUnit , MSTest | Back to top

Comments on this post: Test Categories with BizUnit tests

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

Copyright © charlie.mott | Powered by: | Join free