Ive been trying to get the sample for the BizTalk Map unit testing scenario working. I kept getting the following error:
"Transformation Failure"
This was happening everytime I executed the test even though you could test the map fine in the Visual Studio IDE.
While troubleshooting this I also tried using code which would execute the map in C# outside of the BizTalk Unit Testing feature based on Tommaso's article. When I did this I was getting the following errors:
- The type initializer for 'Microsoft.BizTalk.ScalableTransformation.BTSXslTransform' threw an exception.
- The type initializer for 'Microsoft.BizTalk.CommonSettings.CBizTalkSettingsLookup' threw an exception.
- Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
When I ran Tomasso's application it was able to execute the map successfully which lead me to believe that it must be something to do with the fact the code would be running inside of the MsTest execution environment.
Eventually I found a solution to this. I added a test settings file to my solution and referenced this in the TEST menu so it was the active test settings. When I did this running the test with the BizTalk Unit Testing feature and running the test using C# to execute the map both worked fine. I didnt need to modify any settings in the test settings file, I just left them as the defaults.
Im not quite sure of the exact cause of the problem but this fixed things for me. Its a shame the error messages in this case made things really painful to workout the root cause of the error.