Exemple #1
0
        public void HowMapsWorksMapTest()
        {
            #region Expected Way

            /*********************************************************************************
            * 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;
            map.TestMap(strSourcePO_XML,
                        Microsoft.BizTalk.TestTools.Schema.InputInstanceType.Xml,
                        strDestInvoice_XML,
                        Microsoft.BizTalk.TestTools.Schema.OutputInstanceType.XML);


            //=== Output file should be created as a result of testing the map ===//
            Assert.IsTrue(File.Exists(strDestInvoice_XML));
            #endregion

            //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          ===//
            //mapper.TestMap(strSourcePO_XML,
            //    Microsoft.BizTalk.TestTools.Schema.InputInstanceType.Xml,
            //    strDestInvoice_XML,
            //    Microsoft.BizTalk.TestTools.Schema.OutputInstanceType.XML);

            ////=== Output file should be created as a result of testing the map ===//
            //Assert.IsTrue(File.Exists(strDestInvoice_XML));
        }
Exemple #2
0
        public void HowMapsWorksWithoutPhoneCallsMapTest()
        {
            HowMapsWorks map = new HowMapsWorks();

            //=== Use the HelloWorld sample directory path for the message files ===//

            string strSourcePO_XML    = testContextInstance.TestDir + "..\\..\\..\\Files\\PersonOrigin2.xml";
            string strDestInvoice_XML = testContextInstance.TestDir + "\\OUT\\PersonTargetWithoutTotals.xml";


            //=== Test the map by using the TestMap method of the TestableMapBase class ===//

            map.ValidateOutput = true;
            map.TestMap(strSourcePO_XML,
                        Microsoft.BizTalk.TestTools.Schema.InputInstanceType.Xml,
                        strDestInvoice_XML,
                        Microsoft.BizTalk.TestTools.Schema.OutputInstanceType.XML);


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

            Assert.IsTrue(File.Exists(strDestInvoice_XML));
        }