예제 #1
0
        public void Send_XmlAssemblerSchemasAddedToPipeline()
        {
            XmlAssembler xml = Assembler.Xml()
                               .WithDocumentSpec <Schema1_NPP.Root>();
            SendPipelineWrapper pipeline = Pipelines.Send()
                                           .WithAssembler(xml);

            string name = typeof(Schema1_NPP.Root).AssemblyQualifiedName;

            Assert.IsNotNull(pipeline.GetKnownDocSpecByName(name));
        }
예제 #2
0
        public void Send_FullPipeline()
        {
            XmlAssembler xml = XmlAssembler.Xml()
                               .WithDocumentSpec <SimpleBody>()
                               .WithEnvelopeSpec <SimpleEnv>();
            SendPipelineWrapper pipeline = Pipelines.Send()
                                           .WithAssembler(xml)
                                           .WithEncoder(new MIME_SMIME_Encoder());

            // Create the input message to pass through the pipeline
            string body =
                @"<o:Body xmlns:o='http://SampleSchemas.SimpleBody'>
               this is a body</o:Body>";
            // Execute the pipeline, and check the output
            // we get a single message batched with all the
            // messages grouped into the envelope's body
            IBaseMessage outputMessage = pipeline.Execute(
                MessageHelper.CreateFromString(body),
                MessageHelper.CreateFromString(body),
                MessageHelper.CreateFromString(body)
                );

            Assert.IsNotNull(outputMessage);
        }