ExecuteSendPipelineStep

Jan 26, 2012 at 4:33 PM

Hi everyone I have problem to make a simple test for a SendPipeline with ExecuteSendPipelineStep. I tried with both with Flat file Assembler and XML Assembler in the SendPipeline.

The example I been trying with is \Microsoft BizTalk Server 2010\SDK\Samples\Pipelines\AssemblerDisassembler\FlatFileSend

The error message I get is

est method TestProject1.UnitTest1.TestMethod1 threw exception:

BizUnit.TestStepExecutionException: BizUnit encountered an error executing a test step ---> System.InvalidOperationException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: <parent xmlns=''> was not expected.

Thank you in advance!

Stefan

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BizUnit.Xaml;
using BizUnit.TestSteps.BizTalk.Pipeline;
using System.Reflection;
using System.Xml.Serialization;

namespace TestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            var testCase = new TestCase { };
            
            var docSpecDefinition = new DocSpecDefinition();
            docSpecDefinition.AssemblyPath = Assembly.GetAssembly(typeof(Microsoft.Samples.BizTalk.FlatFileSend.PO)).CodeBase; 
            //  docSpecDefinition.TypeName = "BizUnit4_BizProject.Schemas.TestSchema";
            docSpecDefinition.TypeName = typeof(Microsoft.Samples.BizTalk.FlatFileSend.PO).FullName;


            ExecuteSendPipelineStep executeSendPipelineStep = new ExecuteSendPipelineStep();
            executeSendPipelineStep.Destination = @"c:\Temp\out";
            executeSendPipelineStep.DocSpecs.Add(docSpecDefinition);

            executeSendPipelineStep.InputContextDir = @"c:\Temp\in";
            executeSendPipelineStep.InputContextSearchPattern = "*.xml";
            //executeSendPipelineStep.InstanceConfigFile
            executeSendPipelineStep.OutputContextFile = "out.txt";

            executeSendPipelineStep.PipelineAssemblyPath = Assembly.GetAssembly(typeof(Microsoft.Samples.BizTalk.FlatFileSend.FFSendPipeline)).CodeBase;
            executeSendPipelineStep.PipelineTypeName = typeof(Microsoft.Samples.BizTalk.FlatFileSend.FFSendPipeline).FullName;
            executeSendPipelineStep.SearchPattern = "*.*";
            executeSendPipelineStep.SourceDir = @"c:\Temp\in";
            // executeSendPipelineStep.SourceEncoding
        

            
            testCase.ExecutionSteps.Add(executeSendPipelineStep);

            
            // Create a new instance of BizUnit and run the test
            var bizUnit = new BizUnit.BizUnit(testCase);

            bizUnit.RunTest();
            

        }
    }
}