我正在使用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;
}