Shadab has written a good post on how you can write a wrapper for the TestableMapBase class to get around current problems with BizTalk 2013 map unit tests. Come on Microsoft, fix this soon….I suppose we should log it first 🙂

shadabanwer

While working on the BTS2013 project, I started writing unit test for Schemas and Maps. I found that unit test for maps do not work anymore with the BTS2013 upgrade. I keep on getting “Transform failure” error messages. I with the help of one of my colleague figure out actually Microsoft had missed on to upgrade TestableMapBase class. They still using the BTSXslTransform instead of using XslCompiledTransform.

This post is to show how we can resolve this issue by creating wrapper class and changing the TestableMapBase class to use XslCompiledTransform.

I used reflector to pull out source code from the Microsoft.BizTalk.TestTools. Re-factor it to use in the wrapper class and change the use of BTSXslTransform to XslCompiledTransform and re-written the PerformTransform method as per below.

The below code is using XslCompiledTransform method rather then BTSXslTransform in TestMapTransform.cs.

image

The below code is re-written to call Transform Load and transform method in…

View original post 72 more words