public void ReceivePipelineDslGrammarVariant2() { // not fluent-DSL var pipeline = new ReceivePipeline <Pipelines.XmlReceive>(); pipeline.Stages.Decode.Component <FailedMessageRoutingEnablerComponent>().Enabled = false; pipeline.Stages.Disassemble.Component <XmlDasmComp>().DocumentSpecNames = new SchemaList { new SchemaWithNone(Schema <Any> .AssemblyQualifiedName), new SchemaWithNone(Schema <Claim.CheckIn> .AssemblyQualifiedName) }; pipeline.Stages.Disassemble.Component <XmlDasmComp>().RecoverableInterchangeProcessing = true; pipeline.Stages.ResolveParty.Component <PolicyRunnerComponent>().Policy = Policy <ProcessResolver> .Name; var binding = ((IPipelineSerializerFactory)pipeline).GetPipelineBindingSerializer().Serialize(); // fluent-DSL second variant var pipeline2 = ReceivePipeline <Pipelines.XmlReceive> .Configure( pl => pl .Decoder <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; }) .Disassembler <XmlDasmComp>( c => { c.DocumentSpecNames = new SchemaList { new SchemaWithNone(Schema <Any> .AssemblyQualifiedName), new SchemaWithNone(Schema <Claim.CheckIn> .AssemblyQualifiedName) }; c.RecoverableInterchangeProcessing = true; }) .PartyResolver <PolicyRunnerComponent>(c => { c.Policy = Policy <ProcessResolver> .Name; })); var binding2 = ((IPipelineSerializerFactory)pipeline2).GetPipelineBindingSerializer().Serialize(); Assert.That(binding2, Is.EqualTo(binding)); }
public void ReceivePipelineSerializeKeepsOnlyStagesWhoseComponentsDefaultConfigHasBeenOverridden2() { var pipeline = ReceivePipeline <Pipelines.XmlReceive> .Configure( pl => pl .FirstDecoder <FailedMessageRoutingEnablerComponent>(c => { c.Enabled = false; }) .FirstDecoder <ActivityTrackerComponent>( c => { c.Enabled = true; c.TrackingModes = ActivityTrackingModes.Claim; })); var binding = ((IPipelineSerializerFactory)pipeline).GetPipelineBindingSerializer().Serialize(); Assert.That( binding, Is.EqualTo( "<Root><Stages>" + "<Stage CategoryId=\"9d0e4103-4cce-4536-83fa-4a5040674ad6\">" + "<Components>" + "<Component Name=\"Be.Stateless.BizTalk.Component.FailedMessageRoutingEnablerComponent\">" + "<Properties><Enabled vt=\"11\">0</Enabled></Properties>" + "</Component>" + "<Component Name=\"Be.Stateless.BizTalk.Component.XmlTranslatorComponent\">" + "<Properties />" + "</Component>" + "<Component Name=\"Be.Stateless.BizTalk.Component.ContextPropertyExtractorComponent\">" + "<Properties />" + "</Component><Component Name=\"Be.Stateless.BizTalk.Component.PolicyRunnerComponent\">" + "<Properties />" + "</Component>" + "<Component Name=\"Be.Stateless.BizTalk.Component.ActivityTrackerComponent\">" + "<Properties><Enabled vt=\"11\">-1</Enabled><TrackingModes vt=\"8\">Claim</TrackingModes></Properties>" + "</Component>" + "<Component Name=\"Be.Stateless.BizTalk.Component.XsltRunnerComponent\">" + "<Properties />" + "</Component>" + "</Components>" + "</Stage>" + "</Stages></Root>")); }