Exciting news… Version of BizTalk Mapper Extensions UtilityPack for BizTalk Server 2013 is now available!

Project Description

BizTalk Mapper Extensions UtilityPack is a set of libraries with several useful Functoids to include and use it in a map, which will provide an extension of BizTalk Mapper capabilities.

Here’s the change-log for this release:

  • Fixes bugs in the String Replace Functoid
What’s new in this minor version?

This is a minor release of this project that is intended to fix some one minor problem reported in the String Replace Functoid.

It was reported that when trying to be replace a Carriage Return\Line Feed (“\r\n”) inside an element the functoid didn’t work and the reason way this happen is that the XSLT code will translate the string “\r\n” to “\\r\\n”. This release will fix that problem. It may not work for every “special characters” however if you find some more problems you can report them that we will address them.

You can found and download Source Code, Application Binaries and Documentation in CodePlex BizTalk Mapper Extensions UtilityPack home page:

BizTalk Mapper Extensions UtilityPack


or from MSDN Code Gallery:

BizTalk Mapper Extensions UtilityPack for BizTalk Server 2013 (628.8 KB)
Microsoft | MSDN Code Gallery

This last few days were quite busy in terms of speaking engagements. In less than 1 months I was invited to speak in 3 events: BizTalk Innovation Day Oslo, LIX Edition of SQLPort Community (Porto – Portugal) and in SQLSaturday #341 – Porto, Portugal.

BizTalk Innovation Day Oslo 2014

The first one was in September 25 – BizTalk Innovation Day Oslo, in which I am also a member of the organization team – BizTalkCrew, this was the third consecutive year that this event was third consecutive year but the first time in Oslo, since the others were held in Stavanger. Around 60 attendees + speakers + event organizers, attended the event especially from Norway and Sweden, 5 Microsoft Integration MVP’s present, 3 Sponsors (Microsoft, Bouvet and BizTalk360) and an incalculable number of networking hours these are some of the numbers that reflect the success of this event. These are some of the numbers that reflect the great success of this event!


This was a special event for me! Because after 1 year and a half of hard work I finally release and public announce my free Book about “BizTalk Mapping Patterns & Best Practices” – a 400-page recipe for BizTalk Developers to develop effective, robust, and organized maps that he has previous announce during the BizTalk Summit 2014, London event.


You can download it at BizTalk360 website here.

My Session – The new Transform Designer available in BizTalk Services

My session was about the new Transform Designer available in BizTalk Services were I addressed the basic differences between the BizTalk Server Mapper and the new Mapper in BizTalk Services, the challenges present while migrating current BizTalk Server maps and how can this task be accomplished. And of course how can we accomplish some of the basic transformation tasks like grouping, shorting and condition transformations. I end my presentation with a very complex transformation challenger that took me a week to solve: mapping a SAP invoice to an EDI Invoice document and wrapping up with the “the good, the bad and the ugly” features of the new Transform Designer.


You can see the full story of the event here: BizTalk Innovation Day, Oslo – story of the day


LIX Encontro da Comunidade SQLPort

The second event was a 20-minute talk in the LIX Edition of SQLPort Community meeting in Porto, Portugal about the Concepts and challenges of Enterprise Integration and how can BizTalk Server and BizTalk Services can address them and help organizations in their needs. An Introduction to BizTalk Server. What is? What does BizTalk do? And an Introduction to BizTalk Services. What is? What does BizTalk Services do?



SQLSaturday #341 – Porto

This was the fourth time that this conference took place in Portugal, but it was the first time that was held in Porto, so was very proud and honor to be selected by the attendees to speak in my first SQLSaturday and in particular to be in my home town. The event was a great success! 22 sessions divided into three tracks, national and international speakers and despise I don’t have official numbers, more than 200 attendees must have passed by the event during the day.


My Session – Introduction to Microsoft Azure BizTalk Services

I had the pleasure to speak at SQLSaturday #341 Porto to a bright young audience that never heard about BizTalk Server/Services… Hoping to open the door for a new integration “BizTalk” genius and why not working with me!


In this session spoke about the existent functionalities in the new integration services in the cloud: Microsoft Azure BizTalk Services: EAI (Enterprise Application Integration) and EDI (Electronic Data Interchange), the challenges in moving from BizTalk Server to BizTalk Services. And the evolving challenges of Enterprise Integration.


I was also honor to represent my company DevScope, gold sponsor of this event, in the awards ceremony session. DevScope has offered an entry to Microsoft Azure Machine Learning Master Class that will be held in November 22 in Porto


This post is for the BizTalk Server and SQL Server Portuguese Community, will be held on October 15, 2014 between 18:30 – 21:50 the LIX SQLPort Community Meeting at the Science and Technology Park of University of Porto (UPTEC) in Oporto.


LIX Encontro da comunidade SQLPort

Realiza-se no dia 15 de Outubro de 2014, o LIX Encontro da comunidade SQLPort, que tem como objectivo a partilha de experiências e conhecimento entre os profissionais e entusiastas de SQL Server em Portugal. O evento vai ser realizado no PORTO, no auditório da UPTEC, pelas 18:30, sendo a entrada livre para todos os inscritos.

Os nossos oradores confirmados são Sandro Pereira (MVP), Ivan Campos, Rui Marinho, Niko Neugebauer (MVP), Fabiano Amorim (MVP) e Murilo Miranda (MVP)

As sessões estão sobre segredo absoluto mas será um evento a não perder!

A Agenda…

18:30: Abertura e recepção;

19:30: Community News

19:10: 3 Apresentações – Oradores

20:10: Networking / Coffee Break;

20:30: 3 Apresentações – Oradores

21:30: Sorteio de prémios

21:30: Fim do evento;

22:00: Jantar livre

Data Evento: 15 Outubro 2014 – 18:30H

Local do Evento: Parque de Ciência e Tecnologia da Universidade do Porto (UPTEC) | Rua Alfredo Allen, n.º455/461 | 4200-135 PORTO | Portugal

Saiba mais sobre o evento na página da Comunidade SQLPort.

O evento é gratuito! De que está à espera? Reserve já o seu lugar aqui e participe!

Estamos a sua espera.

I’m proud to announce that I will present a session about BizTalk Services: “Introduction to Microsoft Azure BizTalk Services” at SQLSaturday #341 Porto (Portugal) on October 18th, 2014! I’m excited and it is truly an honor because this is the first time I submit a session to this kind of event and I have been selected by the attendees to speak at a SQLSaturday in my home town.


This is the fourth time that this conference takes place in Portugal, but it is the first to be held in Porto, and will have three “tracks” with parallel sessions in three different topics Administration/Development (DBA), Business Intelligence (BI) and Development (.NET).

About my session…

Historically, both EAI and EDI has been performed through BizTalk. With this preview we will give an early glimpse into how Microsoft envisions these types of integration scenarios being addressed in a Platform as a Service (PaaS) based environment.

In this session we’ll look at the existent functionalities in the new integration services in the cloud: Microsoft Azure BizTalk Services: EAI (Enterprise Application Integration) and EDI (Electronic Data Interchange), how to manage the exchange of EDI messages and trading partners through BizTalk Services Portal; Support Flat files, schemas and transformations (maps). And at the challenges in moving from BizTalk Server to BizTalk Services.

Session Level: Beginner

About my coleagues at DevScope…

The event will have well known international speakers, however I want to highlight my coleagues at DevScope that were also invited to deliver sessions at this event. And the contributions of DevScope range from Cloud Services to Server Automation or Mobile Development. There will be plenty of opportunities to meet us in our hometown:

See more about DevScope contribution here: SQLSaturday comes to Porto on Oct 18th

Event scheduler…

My session will start at 12 PM in the Development (.NET). track – room 3 and I will be waiting for you!


Chech the full event scheduler here: SQLSaturday #341 Event Scheduler

This is a FREE training event for Data Professionals, Students & Enthusiasts, which shall be held on 18th October 2014 at ISEP – Rua Dr. António Bernardino de Almeida, 431. Admittance to this event is free, all costs are covered by sponsorships.

Please register quickly here: https://www.sqlsaturday.com/341/register.aspx because seating is limited, and let friends and colleagues know about the event.

I public announced for the first time that I was working in an eBook about BizTalk Mapping Patterns and Best Practices, and that it would be published for free, this March during BizTalk Summit 2014 London… Well folks, it’s that time to announce that “BizTalk Mapping Patterns and Best Practices” book – a 400-page recipe for BizTalk Developers to develop effective, robust, and organized maps – is now finally available for you to download at BizTalk360 website here.


The “BizTalk Mapping Patterns and Best Practices” book is a reference guide mainly intended for BizTalk developers to make their day-to-day lives easier. The book offers insights on how maps work, the most common patterns in real time scenarios, and the best practices to carry out transformations and has as technical reviewers Steef-Jan Wiggers, Nino Crudele, Michael Stephenson and José António Silva. I had been working on this over the last one year, and my original idea of publishing these information as a blog changed in the due course to become a white paper, then finally to a “Community eBook” with about 400-pages and contributions from so many people. I need to thanks BizTalk360 to accept the challenge of publishing its first book and make it available to the community and my employer, DevScope, for given me a lot of leverage to spend time writing this book, but also to actively contribute for the community of BizTalk with articles, blog and conferences.

I would also like to thank my fantastic team of Technical Reviewers composed by three Integration MVP’s: Michael Stephenson, Nino Crudele and Steef-Jan Wiggers and for the person responsible for the initial idea: José António Silva. Thank you for accepting the challenger and thank you for the incredible effort and time to increase the quality of the book. And also to my friend Sónia Gomes (http://ideiasaoscaracois.com) for creating this amazing cover for the book.

Key Features
  • Direct Translation Pattern: Simply move data to a different semantic representation without any manipulation or transformation.
  • Data Translation Pattern: Similar to Direct Translation Pattern with additional step of data manipulation or transformation to match the target system format.
  • Content Enricher Pattern: Set up access to an external data source (say, a database) to enhance the message with missing information.
  • Aggregator Pattern: Similar to Content Enricher Pattern; difference in mapping technique. Multiple inbound requests mapped to single outbound request.
  • Content Filter Pattern: Opposite of Content Enricher Pattern; remove unnecessary items from message (even based on condition) and send what is exactly required
  • Splitter Pattern: Opposite of Aggregator Pattern; single inbound request to be mapped to several outbound requests
  • Grouping Pattern: Example – shopping catalogue where items are grouped under categories like Sports, Women Cosmetics, Electronics, Computers, and so on.
  • Sorting Pattern: In most scenarios, Grouping Pattern and Sorting Pattern will be bound together
  • Conditional Pattern: To receive only portion of the data from the message, apply a condition statement to filter the result set at the source.
  • Looping Pattern: For instance, a record in the source system may occur multiple times in the input file. They need to be transformed according to the target system
  • Canonical Data Model Pattern: Ensures loose coupling between applications; if new application is added, only the transformation between the Canonical Data Model has to be created.
  • Name-Value Transformation Pattern: Target system requires a Name-Value Pair (NVP) structure; or the source system has a NVP structure and the target requires a hierarchical schema

Click here to download your free copy of the book.

Why I did not choose a “proper” publisher?

Some people have asked me why I didn’t publish my book in a real proper publisher like Apress, Packt Publishing or others and the reason is simple… I could easily and had the chance to publish but it would be a paid book and what I really wanted was to create and deliver to the community my first book (I don’t know if I will write or not more books) for free as a way to thank you for the affection and support that all of you have given me in the last years.

BizTalk360 was the proper choice because I know the people and I know I could count on them to publish making it available to the community for free and promote the book.

When was the book released?

The book was public announced during the BizTalk Innovation Day, Oslo (Norway) 2014 event and I could not have chosen a better place and audience to present my book because the idea of creating this book started after a session of one of our events: BizTalk Innovation Day Oporto, the venue was really amazing in a kind of nightclub for event (actually MESH is also a nightclub J) and the Norwegian audience is really amazing and I have good friends there.

Here is the moment of the official announcement:


Please give me your feedback

Your opinion is very important to me. I appreciate your feedback and I will use it to evaluate changes and make improvements in the book and future projects.


Download the book for free


The book if available for you to download for free at BizTalk360 website here: BizTalk Mapping Patterns & Best Practices

I miss the old BizTalk Hotrod Magazine, of my knowledge, there isn’t no other type of magazine about BizTalk Server. And the only thing we have approximately to that is the Flipboard BizTalk Magazine that I have weekly published throughout these last months.

You can find the BizTalkMagazine into Flipboard in in your favorite device Apple (iPhone, iPad), Android, Windows 8, and so on… or simply through the Internet browser at: https://flipboard.com/section/biztalkmagazine-bMJFWI

I start this project because I didn’t have the knowledge and the time required to create a PDF magazine similar to the BizTalk Hotrod Magazine, and Flipboard gave me an easy and simple way to share content in a type of magazine format.

Now it seams a little limited and after all this months I would like to take the magazine to a new level and recreate some of the concept of BizTalk Hotrod magazine, inviting authors to write articles to be published and share other resources like tools, scripts, adapters and so on… probably launching a magazine every month or quarterly.

To try this concept I decided to publish a beta version of the magazine as a proof of concept that now is available for you to download here: BizTalk Magazine – September 2014 Edition – probably the magazine name should be different.


This first edition contains:

  • BizTalk Innovation Day, Oslo – Norway
  • BizTalk Server 2013: Step-by-Step to implement Unit Testing in Schemas and Maps
  • "INTEGRATE – 2014"– Announcing the Global BizTalk Summit, Microsoft Campus, WA. Dec 3-5, 2014
  • BizTalk Administrator Deep dive course
  • Exposing data through BizTalk Service Hybrid Connections
  • BizTalk Server SQL Agent Jobs

Have a nice read! And If you have any suggestions feel free to comment, your feedback is important.

In the last few weeks I have been doing BizTalk project migrations successfully from BizTalk Server 2006 and Visual Studio 2005 to recent version: BizTalk Server 2010/VS 2010 or BizTalk Server 2013/VS2012. In most of the scenario this is a simple task and regarding to Visual Studio we basically just need to open the “old” solution with the “new” Visual Studio and it will try to convert the solution using the Visual Studio Conversion Wizard tool, check more details in one of my previous post: BizTalk 2010 – Migrate an old BizTalk Visual Studio solution to Visual Studio 2010.

Of course this part is just the Visual Studio project migration, and in some cases we need to make adjustments to our solution.

However recently I face a strange problem when I was trying to convert the Visual Studio solution, every time I tried it gave me the following error:

“Unable to read the project file “…\MyProject.btproj.user”. The project file could not be loaded. Root element is missing.”



“*.btproj.user” file. This is a XML file that contains not only the BizTalk deployment Settings but also several personal user settings like References path, test file names and so on.

I’m not sure what did happen with this file while copying the project to the new server, or during it’s time life in the former development server. However when I check the file system for this file I noticed that the file was empty:



To solve this problem you just need to delete this User configuration file (*.btproj.user) from the file system and try to import de project or convert the solution again.


BizTalk Health Monitor is a snap-in, basically it’s the same of BizTalk MsgBoxViewer tool that we used monitor a BizTalk environment by gathering all information of a BizTalk group and detecting any issues, non-critical or critical warnings to detect any potential problems in advance, but in this case is integrated more closely with the BizTalk Administration Console to provide BizTalk administrators a quick and complete dashboard of a BizTalk group which will help them monitor the health of their BizTalk platform.

You can see more info about BizTalk Health Monitor (BHM) at:

BHM was originally released as a new feature with BizTalk Server 2013 R2 but luckily for us Microsoft decided to release a standalone version of BHM for use with BizTalk Server 2010 and BizTalk Server 2013.

You can download the standalone version of BHM from Microsoft Download Center here: BizTalk Health Monitor

How to install BizTalk Health Monitor snap-in


  • BizTalk Server 2010 or 2013 should be installed and configured.
How to register BizTalk Health Monitor Snap-In

After you download and unzip the BHM.ZIP file from the Microsoft Download Center, you the “InstallUtil.exe” which comes with BizTalk Health Monitor tool to register the BHM snap in.

Important: Unzip the BHM.ZIP to a final destination before you register the snap-in for example: C:\Program Files (x86)\Microsoft BizTalk Server 2010\SDK\Utilities\BHM. Once you register the BizTalk Health Monitor Snap-In you cannot delete the folder or BHM will stop working

To accomplished that we need to:

  • Open a command prompt as an administrator
  • Navigate to the directory file where you unzipped the BHM.ZIP file
    • For example: C:\Program Files (x86)\Microsoft BizTalk Server 2010\SDK\Utilities\BHM
  • And from the command prompt type:
    • InstallUtil.exe MBVSnapIn.dll
  • And hit enter. This step will do some registry changes and register the SnapIn to be used


How to integrate BHM Snap-In into BizTalk Admin Console

Important note: BHM Snap-In can be used independently and need not to be integrated with BizTalk Administration Console. The handicap of this approach is that a BizTalk Administration will need to use two different places/tools to monitor and administrate the environment.

To be easier and more convenience for BizTalk Administrators BHM Snap-In can also be integrate it so that it can be used with BizTalk Administration Console.

To accomplished that we need to open a 32-bit Microsoft Management Console (MMC):

  • Click Start, click Run, type:
    • mmc /32
  • Press enter or click OK. This will open a new 32-bit version of MMC (MMC32).
  • From MMC console, go to File menu and select “Options…” option
    • In the text box, replace “Console1” for “BizTalk Administration Console”
    • In the Console mode combo box, select “User mode – full access”
    • And confirm that the option “Do not save changes to this console” is uncheck


  • From MMC console, go to File menu and select “Add/Remove Snap-in…” option


  • From the “Add or Remove Snap-ins” window, add following snap-ins and then click Ok
    • Microsoft BizTalk Server Administration
    • BizTalk Health Monitor


    • You can add the snap-ins by selecting them from the “Available snap-ins” list and click “Add >”
    • Is recommend that you respect the order present in the “Selected snap-ins” list as showed in the picture above
  • This will generate for us a new MMC which contains both the BizTalk Server Administration and BizTalk Health Monitor. And by now your new MMC is ready which shows both the BizTalk Server Administration and BizTalk Health Monitor


Now you might want to save this as a new .msc file so that you don’t have to repeat these steps again but before we complete the creation process of the “new” BizTalk Administration Console, I recommend that you navigate to the BizTalk Server Installation folder:

  • Example: C:\Program Files (x86)\Microsoft BizTalk Server 2010
  • And rename “BTSmmc.msc” file, for example: “BTSmmc-old.msc”

This because we will save the “new” BizTalk Administration Console as “BTSmmc.msc” so that you don’t need to create new shortcuts or having different ways to access the BizTalk Administration Console – however this step is optional!

To finished the creation process of the “new” BizTalk Administration Console

  • From MMC console, go to File menu and select “Save As…” option:
    • Give a name and then save it.
      • Access to BizTalk Server Installation folder
        • C:\Program Files (x86)\Microsoft BizTalk Server 2010
      • Save the file as “BTSmmc.msc”

From next time onwards, when you open the BizTalk Server Administration Console


The “new” BizTalk Administration Console will be incorporated with the BizTalk Health Monitor


You can download the standalone version of BHM from Microsoft Download Center here: BizTalk Health Monitor

In my last post I explained how to implement Unit Testing in Schemas and Maps in BizTalk Server 2013 project within Visual Studio 2012. I also describe that there is an issue when we try to perform Unit Testing in maps and each time we try to run the unit test it give us the following error: “Microsoft.BizTalk.TestTools.BizTalkTestAssertFailException: Transform Failure

Until Microsoft fix this bug, probably in next releases of CU’s, one workaround that you can implement was described also in my last post, i.e., using a custom wrapper classes based on Microsoft.BizTalk.TestTools.dll to solved the current issues.

However Paul Nichols from Mexia alerted me with a Michael Stephenson post: BizTalk 2013 Map Unit Testing Gotcha, to the fact that I could use a Test Settings file which forces the tests to run in 32-bit mode and solve the problem that I was facing with maps without having the necessity to use a custom assembly… so I decide to try it.

Unit tests in Visual Studio 2012 can be configured by using a “.runsettings” file (“.runsettings” is new in Visual Studio 2012 – if you’re familiar with unit testing in previous versions of Visual Studio, you might know about “.testsettings files”). For example, you can change the .NET Framework on which the tests will be run, the directory where test results are delivered, and the data collected during a test run.

You can still use “.testsettings” in Visual Studio 2012, so any test configurations you wrote for previous editions will still work. But “.testsettings” can be used only to configure tests written for the MSTest adapter. By contrast, “.runsettings” can be used with any of the adapters built for the extensible unit test framework in Visual Studio 2012, such as xUnit.net and NUnit.

You still need a “.testsettings” file for some kinds of tests:

  • Tests that are deployed on a lab environment.
  • Web performance and load tests.
  • Customizing some types of diagnostic data adapters, such as IntelliTrace and ent log
  • BizTalk Server maps (workaround)
Maps Unit Testing Workaround 2 (add .testsettings file)

Unfortunately, if we add a “.runsettings” file and forces the tests to run in 32-bit mode, see an example of this Test Settings file here, our test project still doesn’t work!

However if we take the “.testsettings” file that was generated for example in Visual Studio 2010/BizTalk Server 2010 and add this file to our Test project in Visual Studio 2012/BizTalk Server 2013 or if we add a new “.testsettings” file from our BizTalk solution it works and solve the problem that I was facing, I really don’t know why but is the best workaround that we can implement to solve all the problems.

So to accomplish this we need to:

  • Right click on the BizTalk solution name: “Solution ‘UnitTestingFeatureWithMaps’ (2 projects)”, and select “Add” and them “New Item…”


  • In the “Add New Item – Solution Items” dialog box, expand "Installed" and then choose "Test Settings".
  • From the list of items, select "Test Settings".


  • In the Name box, enter "TestSettings.testsettings", and then click "Add".
  • This will open a new window for us to specify the settings of the test settings file, just leave the default setting by click “Close”.


You can add more than one test settings file if you want to be able to switch quickly between different settings.

  • On the Visual Studio main menu choose "Test", choose "Test Settings", and then choose "Test Settings File".


  • In the "Open Setting File" window select the test setting file that we previous create: "TestSettings.testsettings"


So if we perform the tests again, we will notice that the "Microsoft.BizTalk.TestTools.BizTalkTestAssertFailException: Transform Failure" is solved and the only error that is happening is about a Map output validation failure (intentionally present)


Thanks Paul Nichols for your comments.

To implement BizTalk Server 2013 unit test within Visual Studio 2012 to test Schemas and Map we need to:

  • Open your BizTalk Project in Visual Studio.NET 2012, in this sample: “UnitTestingFeatureWithMaps.sln”
  • In Solution Explorer, right-click in the BizTalk Server project, in this sample “UnitTestingFeatureWithMaps”, and then click Properties.
    • In Project Designer, click the Deployment property page tab and set “Enable Unit Testing” option to “True”.


    • Close the project properties page saving the changes.
  • In main menu, click Build, and then click Rebuild Solution.

To create a unit test project

  • On the File menu, choose “Add”, and then choose “New Project….”
  • In the New Project dialog box, expand “Installed”, expand “Visual C#”, and then choose “Test”.
  • From the list of templates, select “Unit Test Project”.


  • In the Name box, enter “UnitTestProject1″, and then choose “OK”.
  • The “UnitTestProject1″ project is added to the the “UnitTestingFeatureWithMaps” solution.
  • In the “UnitTestProject1″ project, for us to be able to accomplished testing BizTalk Schemas and Maps, we need to manually add the following references to the solution:
    • Microsoft.BizTalk.TestTools – you can find this assembly in the following directory: “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.BizTalk.TestTools.dll”
    • Microsoft.XLANGs.BaseTypes – you can find this assembly in the following directory: “C:\Program Files (x86)\Microsoft BizTalk Server 2013\Microsoft.XLANGs.BaseTypes.dll”
    • BizTalk Server project assembly – in this case “UnitTestingFeatureWithMaps”
  • You can accomplish this by:
    • In Solution Explorer, select “References” in the “UnitTestProject1″ project and then choose “Add Reference…” from the context menu.

We need two test class, one for testing the Schema and the other to test the map. We can use the UnitTest1.cs that was generated by the project template, but we should give the file and class more descriptive names. We can do that in one step by renaming the file in Solution Explorer.

To unit test a schema you can leveraging the unit test framework in Visual Studio. In the Unit Test Class you can test methods like below for validating XML document instance:

        /// <summary>
        ///A test for PersonOrigin Constructor
        public void PersonOriginConstructorTest()
            PersonOrigin target = new PersonOrigin();

            //=== Schema input file for validation ===//
            string strSourcePO_XML = testContextInstance.TestDir + "..\\..\\..\\Files\\PersonOrigin.xml";

            //=== Validate the XML Input message against the schema ===//

To unit test a map you can leveraging the unit test framework in Visual Studio. In the Unit Test Class you can test method like below for testing a mapping:

        public void HowMapsWorksMapTest()
             * There is a bug with Map Unit Test inside Microsoft.BizTalk.TestTools.dll 
             * Microsoft had missed on to upgrade TestableMapBase class. They still using the 
             * BTSXslTransform instead of using XslCompiledTransform witch will cause the 
             * TestMap() function to failed.
             * The following code was the expected code for BizTalk Map unit testing 

            HowMapsWorks map = new HowMapsWorks();

            //=== Use the HelloWorld sample directory path for the message files ===//
            string strSourcePO_XML = testContextInstance.TestDir + "..\\..\\..\\Files\\PersonOrigin.xml";
            string strDestInvoice_XML = testContextInstance.TestDir + "\\OUT\\PersonTarget2.xml";

            //=== Test the map by using the TestMap method of the TestableMapBase class ===//
            map.ValidateOutput = true;

            //=== Output file should be created as a result of testing the map ===//

Maps Unit Testing Workaround (until the hotfix is unavailable)

Unfortunately there is a bug in BizTalk Server 2013 with Map Unit Test inside Microsoft.BizTalk.TestTools.dll, so each time we try to run the unit test for the map it give us the following error:

Microsoft.BizTalk.TestTools.BizTalkTestAssertFailException: Transform Failure
Result StackTrace:   
at Microsoft.BizTalk.TestTools.Mapper.TestableMapBase.PerformTransform(String inputXmlFile, String outputXmlFile)
   at Microsoft.BizTalk.TestTools.Mapper.TestableMapBase.TestMap(String inputInstanceFilename, InputInstanceType inputType, String outputInstanceFilename, OutputInstanceType outputType)

Microsoft had missed on to upgrade TestableMapBase class. They still using the BTSXslTransform instead of using XslCompiledTransform witch will cause the TestMap() function to failed.
You can find a wrapper (provide by  shadabanwer) here: Map Unit test does not work in BizTalk 2013 because TestableMapBase class is not correct. However there is also a problem with schema (input and output) validation options… so I decide to recreated a new custom wrapper based on Microsoft.BizTalk.TestTools.dll and the solution provided by shadabanwer and fixed all the problems because validating the output instance generated by the map is an important step to validate your maps using Unit Testing. You can find this DLL here: BizTalk Server 2013: Wrapper classes to perform Unit Testing in Maps

You must use this workaround until Microsoft fix this bug.

So to be able to successfully test our maps we need to:

        public void HowMapsWorksMapTest()
            HowMapsWorks map = new HowMapsWorks();

            //=== Map input file instance to be mapped  ===//
            string strSourcePO_XML = testContextInstance.TestDir + "..\\..\\..\\Files\\PersonOrigin.xml";
            //=== Path for the Map output file instance with the result of the transformation  ===//
            string strDestInvoice_XML = testContextInstance.TestDir + "\\Out\\PersonTarget2.xml";

            //WORKAROUND SOLUTION to test maps
            SandroPereira.BizTalk.MapTestTools.TestableMapBase mapper = new SandroPereira.BizTalk.MapTestTools.TestableMapBase();

            mapper.Mapper = map;
            mapper.Mapper.ValidateOutput = true;

            //=== Test the map by using the TestMap method of a custom TestableMapBase class ===//
            //=== that uses the XslCompiledTransform. This class is basically an improved    ===//
            //=== clone of the class present in the Microsoft.BizTalk.TestTools DLL          ===//

            //=== Output file should be created as a result of testing the map ===//

Check the full detailed article here: BizTalk Server 2013: Step-by-Step to implement Unit Testing in Schemas and Maps

BizTalk Server 2013: Using the Unit Testing Feature with Schemas and Maps (500.3 KB)
Microsoft | TechNet Gallery