1

我正在使用 BizUnit 框架测试我的 BizTalk 接收管道。

我需要测试一个自定义管道组件,为此我需要设置该组件的属性。在添加管道时,可以从 Biztalk 管理控制台看到这些属性。

注意:我不想使用自定义代码在组件中推广这些属性和设置。

如何在 BizUnit 中设置管道组件属性?

下面是我正在使用的代码片段。

    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;
        }
4

0 回答 0