This project is read-only.

What the framework consist of?

TransMock consist of the following modules:
- Mock adapter - a WCF adapter for BizTalk server
- Mockifier - a command line tool that automatically mocks the required endpoints in a BizTalk bindings file
- BizUnit steps - 4 test steps for integrating with BizUnit
- BTDF extension - a MSBuild script for extending the behavior of the BTDF framework

Mock adapter

This is the cornerstone of the framework - it allows for feeding messages in to a BizTalk integration from a BizUnit test as well as sending messages out from a BizTalk integration to a BizUnit test. The addressing space for this adapter is mock://. The URI structure is defined as follows: mock://<host name>/<Endpoint name>[/<Operation name>] where the host name is the name of the BizTalk server or localhost, endpoint name is the name of the corresponding receive location or send port. The last part - operation name, is optional and is intended to be used in cases where a more granular URIs are preferred.


This is a command line tool that is parsing a BizTalk server bindings file and looks for receive locations and send ports that are tagged with a specific tag in a comment block. The ones that are tagged are parsed in a such a way so that the transport data is changed with the one for the mock adapter for the given message exchange pattern, e.g. one-way or 2-way.
In addition the Mockifier generates a helper C# class called <BizTalk Application name>MockAddresses
which contains the mocked URLs exposed as properties. Each property is named after the corresponding endpoint that has been mocked. This makes it rather convenient to utilize this class in authoring the test cases. Currently this class is saved under the Deployment folder of the solution, so it has to be manually added to the test project.

BizUnit test steps

The 4 BizUnit test steps that are implementing the integation with BizUnit are as follows:

MockReceiveStep - implements reception of a one way message from BizTalk server. This step is ideal for emulating communication to an FTP server or a file folder for instance.

MockSendStep - implements the ability for sending a one way message to BizTalk server. This step is ideal for emulating reception of a message over a queue, FTP server or file folder for instance.

MockRequestResponseStep - implements a two way communication by receiving a request from BizTalk server and supplying a response back to it. This step is ideal for emulating any kind of web service endpoints consumed by BizTalk.

MockSolicitResponseStep - implements a two way communication by sending a request to BizTalk server and awaiting a response back from it. This steps is ideal for emulating reception of messages by a web service endpoint exposed by BizTalk server for instance.

The naming of the steps is following the standard convention for BizUnit test steps - it starts with the transport name and then followed by the particular operation implemented by the step.
All the steps have a property called URL and it should always be set to the corresponding URI of the matching BizTalk endpoint that a step instance is intended to communicate with.

BTDF extension script

The script called TransMock.targets extends the behavior of BTDF by plugging in the CustomDeployTarget target from BTDF and invoking the Mockifier with appropriate parameters. There is a propery group property defined in that script which should be set in the btdfproj in order for it to work properly. It is called TransMockHomeDir and should point to the folder where TransMock has been installed. The script sets a default value for this property which is the default installation directory, so it should be necessary to change it only in the case the installation directory of TransMock is different from the default one.

Last edited Aug 4, 2014 at 8:57 PM by cyberbyber, version 2