Tanuj Wadhwa
Tanuj Wadhwa

Reputation: 2045

Setting Pipeline component properties for BizUnit Testing

I am testing my BizTalk receive pipeline using BizUnit framework.

I need to test a custom pipeline component & for that I need to set the properties of that component. These properties can be seen from Biztalk admin console while adding the pipeline.

Note : I don't want to promote those properties & set in the component using custom code.

How can I set the pipeline component properties in BizUnit?

Below is the snippet of the code I am using.

    try
        {
            var testCase = new TestCase { };

            var docSpecDefinition = new DocSpecDefinition();

            docSpecDefinition.AssemblyPath = @"file:///C:/windows/myschema.dll";
            docSpecDefinition.TypeName = @"mynamespace";

            var executeReceivePipelineStep = new ExecuteReceivePipelineStep();

            executeReceivePipelineStep.DestinationFileFormat = "*.xml";
            executeReceivePipelineStep.Source = @"D:/Employee.xml";
            executeReceivePipelineStep.DestinationDir = @"C:/Temp";
            executeReceivePipelineStep.DestinationFileFormat = ".xml";
            executeReceivePipelineStep.PipelineAssemblyPath = @"file:///C:/windows/mypipeline.dll";
            executeReceivePipelineStep.PipelineTypeName = @"pipelinename.mypipeline";

            executeReceivePipelineStep.DocSpecs.Add(docSpecDefinition);

            testCase.ExecutionSteps.Add(executeReceivePipelineStep);

            var bizUnit = new BizUnit.BizUnit(testCase);
            bizUnit.RunTest();
            TestCase.SaveToFile(testCase, @"C:/testcase.xml");

        }
        catch (Exception exception)
        {
            var message = exception.InnerException;
            throw;
        }

Upvotes: 1

Views: 109

Answers (0)

Related Questions