Attention: We are retiring the ASP.NET Community Blogs. Learn more >

NUnit testing BizTalk orchestrations?

Has anybody looked at building an NUnit extension for BizTalk orchestrations?

To me, writing unit tests is absolutely essential. Right now, testing BizTalk orchestrations is really a PITA. It's extremely manual because out-of-the-box, there is really no support to develop repeatable, automatically executable unit tests for a BizTalk orchestration.

One approach could be building a testing framework that deploys an orchestration and sets up custom bindings and then sending messages to the receive ports and checking the messages emitted from send ports. However, that approach requires a running BizTalk server, creating and tearing down send and receive locations, yadaa, yadaa, yadaa.

A much less invasive approach would just load the compiled BizTalk assembly into a generic test harness, and directly hook into the orchestration ports. An NUnit extension for BizTalk like the ASP.NET extensions in NUnitAsp sounds like the perfect approach. You would probably need a tool to discover the ports and set up a code framework to send and receive from those ports, but that has to be possible because it's similar to what the BizTalk runtime does.

I looked at a compiled orchestration with Reflector for less than 5 minutes and was able to make out the orchestration and the schema types.

Has anybody else gone further and actually tried discovering the port and sending messages to it?

3 Comments

  • Dig around. I ran into someone's blog talking about how he was working on just this kind of thing.

  • Kent,



    Thanks for the pointer. I've seen Scott Colestock's Nant task, which does provide some relief with the rather tedieous BizTalk debugging.



    What I am looking for is a closer tie-in of BizTalk into NUnit so I don't even have to go through the whole deploy/bind/enlist/start/stop/unenlist/undeploy cycle -- at least for stand-alone orchestrations.



    I'll keep digging around.

  • I've gone a bit further today and actually dug quite deeply with Reflector. Needless to say, it is very challenging trying to figure out how to even construct an Orchestration. If I figure that out, maybe then we can try to figure out which of the 100 methods available I would actually call...

Comments have been disabled for this content.