public void SerializeToXml()
        {
            var npa = new WcfNetNamedPipeAdapter.Outbound(
                a => {
                a.Address                  = new EndpointAddress("net.pipe://localhost/biztalk.factory/service.svc");
                a.SecurityMode             = NetNamedPipeSecurityMode.Transport;
                a.SendTimeout              = TimeSpan.FromMinutes(2);
                a.TransportProtectionLevel = ProtectionLevel.EncryptAndSign;
            });
            var xml = ((IAdapterBindingSerializerFactory)npa).GetAdapterBindingSerializer().Serialize();

            Assert.That(
                xml,
                Is.EqualTo(
                    "<CustomProps>" +
                    "<MaxReceivedMessageSize vt=\"3\">65535</MaxReceivedMessageSize>" +
                    "<EnableTransaction vt=\"11\">0</EnableTransaction>" +
                    "<TransactionProtocol vt=\"8\">OleTransactions</TransactionProtocol>" +
                    "<SecurityMode vt=\"8\">Transport</SecurityMode>" +
                    "<TransportProtectionLevel vt=\"8\">EncryptAndSign</TransportProtectionLevel>" +
                    "<InboundBodyLocation vt=\"8\">UseBodyElement</InboundBodyLocation>" +
                    "<InboundNodeEncoding vt=\"8\">Xml</InboundNodeEncoding>" +
                    "<OutboundBodyLocation vt=\"8\">UseBodyElement</OutboundBodyLocation>" +
                    "<OutboundXmlTemplate vt=\"8\">&lt;bts-msg-body xmlns=\"http://www.microsoft.com/schemas/bts2007\" encoding=\"xml\"/&gt;</OutboundXmlTemplate>" +
                    "<PropagateFaultMessage vt=\"11\">-1</PropagateFaultMessage>" +
                    "<OpenTimeout vt=\"8\">00:01:00</OpenTimeout>" +
                    "<SendTimeout vt=\"8\">00:02:00</SendTimeout>" +
                    "<CloseTimeout vt=\"8\">00:01:00</CloseTimeout>" +
                    "</CustomProps>"));
        }
        public void ValidateDoesNotThrow()
        {
            var npa = new WcfNetNamedPipeAdapter.Outbound(
                a => {
                a.Address                  = new EndpointAddress("net.pipe://localhost/biztalk.factory/service.svc");
                a.SecurityMode             = NetNamedPipeSecurityMode.Transport;
                a.TransportProtectionLevel = ProtectionLevel.EncryptAndSign;
            });

            Assert.That(() => ((ISupportValidation)npa).Validate(), Throws.Nothing);
        }