ExecuteMapStep

Jan 30, 2012 at 5:28 PM

I have a pretty simple test, my first one, in which I am trying to validate the output of a map using the ExecuteMapStep. Here is the test

<TestCase testName="XformActivityMessageMapTest">
	<TestSetup>
		<TestStep assemblyPath="" typeName="BizUnit.FileDeleteMultipleStep">
			<Directory>C:\BizTalkReceivers\Receive</Directory>
			<SearchPattern>*.xml</SearchPattern>
		</TestStep>
		<TestStep assemblyPath="" typeName="BizUnit.FileDeleteMultipleStep">
			<Directory>C:\BizTalkSenders\Exception</Directory>
			<SearchPattern>*.xml</SearchPattern>
		</TestStep>		
	</TestSetup>
	<TestExecution>
		<TestStep assemblyPath="BizUnit.BizTalkSteps.dll" typeName="BizUnit.BizTalkSteps.ExecuteMapStep">
			<Map assemblyPath="mypath.ProductOrder.Maps.dll" typeName="mymaps.XformActivityMessageFromPCProductOrder"/>
			<Source>TestArtifacts\thesource.xml</Source>
			<Destination>thedestination.xml</Destination>
			<ValidationStep assemblyPath="" typeName="BizUnit.XmlValidationStepEx">
				<XmlSchemaPath>source1.xsd</XmlSchemaPath>
				<XmlSchemaNameSpace>http://spource1</XmlSchemaNameSpace>
				<XPathList>
					<XPathValidation query="/*[local-name()='AccountIncoming' and namespace-uri()='http://source1']/*[local-name()='TransactionSet' and namespace-uri()='http://source1']/*[local-name()='CProject' and namespace-uri()='http://source1']">008031</XPathValidation>					
				</XPathList>
			</ValidationStep>
		</TestStep>
	</TestExecution>
</TestCase>

 

The issue is that the output is a blank xml doc. This results in the Validation step failing. any ideas as to why the output would be blank? It works when I run the entire solution and us a xdoc variable to spit it to a file location.

 

Thanks, Chuck

Feb 6, 2012 at 12:32 PM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

using

 

 

System;

using

 

 

System.Text;

using

 

 

System.Collections.Generic;

using

 

 

System.Linq;

using

 

 

Microsoft.VisualStudio.TestTools.UnitTesting;

using

 

 

BizUnit.Xaml;

using

 

 

BizUnit.TestSteps.BizTalk.Map;

 

namespace

 

 

TestProject1

{

[

 

TestClass

]

 

 

public class

UnitTest1

{

[

 

TestMethod

]

 

 

public void

TestMethod1()

{

 

 

var totalItemsTest = new TestCase

{ };

BizUnit.

 

BizUnit bz = new BizUnit.BizUnit

(totalItemsTest);

 

 

BizTalkMapTester mapTester = new BizTalkMapTester(typeof(EAISchemas2.MapToReqDecline

));

 

 

string source =@"C:\Users\stelau\Documents\visual studio 2010\Projects\EAISolution2\RequestInstance.xml"

;

 

 

string destination = @"C:\temp\out\out.xml"

;

 

 

 

mapTester.Execute(source, destination);

 

 

 

how to do it with c# code , very easy  !!

 

 

}

}

}

 

Feb 6, 2012 at 12:32 PM
Edited Feb 6, 2012 at 12:34 PM

 

 

 Sorry about how it looks problem insert code snippet

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TestClass

 

 

 

public class

 

 

 

 

TestMethod

 

 

 

public void

 

 

 

var totalItemsTest = new TestCase

 

 

 

BizUnit bz = new BizUnit.BizUnit

 

 

 

BizTalkMapTester mapTester = new BizTalkMapTester(typeof(EAISchemas2.MapToReqDecline

 

 

 

string source =@"C:\Users\stelau\Documents\visual studio 2010\Projects\EAISolution2\RequestInstance.xml"

 

 

 

string destination = @"C:\temp\out\out.xml"

 

 

 

 

 

;

 

 

 

 

 

mapTester.Execute(source, destination);

 

 

 

how to do it with c# code , very easy  !!

 

 

}

}

}

 

 

;

 

 

 

));

 

 

 

(totalItemsTest);

 

 

 

{ };

 

 

 

TestMethod1()

 

 

{

 

 

]

 

 

 

 

 

 

UnitTest1

 

]

 

 

 

TestProject1

 

 

{

 

 

BizUnit.TestSteps.BizTalk.Map;

 

 

 

 

BizUnit.Xaml;

 

Microsoft.VisualStudio.TestTools.UnitTesting;

 

System.Linq;

 

System.Collections.Generic;

 

System.Text;

 

System;

 

[

 

 

 

BizUnit.

 

 

 

{

[

namespace

using

using

using

using

using

using

using