views:

877

answers:

1

Can anyone explain how to get unit tests of BizTalk maps with multiple inputs to work?

I've been happily using the examples on Michael Stephenson blog to test my maps, but I've just tried my first multiple input map and it's failing :-(

I've used the VS2005 "Test Map" to first generate an input instance with the two input messages, then used varieties of that file as test inputs ...

<ns0:Root xmlns:ns0="http://schemas.microsoft.com/BizTalk/2003/aggschema"&gt;
  <InputMessagePart_0>
    ...
  </InputMessagePart_0>
  <InputMessagePart_1>
    ...
  </InputMessagePart_1>
</ns0:Root>

These test messages generate the expected output when I use the VS Test Map, but a section is missing when I try the unit tests.

The only thing I can think of is the map has some functoids in ... Scripting, Table Extractor and Table Looping ...

The unit test calls the StreamingTransform.ScalableTransform ...

// This is the BizTalk Server 2006 way of calling 
mapInstance.StreamingTransform.Transform(inputStream, 
    mapInstance.TransformArgs, outputStream, resolver);
// This is the R2 way of calling
XmlReader xmlRdr = new XmlTextReader(inputStream);
mapInstance.StreamingTransform.ScalableTransform(xmlRdr, 
    mapInstance.TransformArgs, outputStream, 
    resolver, whitespaceCorrect);

and the alternative approach of using the Transform.Transform doesn't work either ...

XPathDocument doc = new XPathDocument(inputStream);
mapInstance.Transform.Transform(doc, mapInstance.TransformArgs, outputStream);
A: 

Hi

Have you tried this:

mapInstance.Transform.Transform(multi-part input message filepath, out put file path);

It works for me. I have decleared mapInstance as an object of the Map class (not declared it as TestableMapBase).