public void SerializeToXml() { var nma = new WcfNetMsmqAdapter.Inbound( a => { a.Address = new EndpointAddress("net.msmq://localhost/private/service_queue"); a.SecurityMode = NetMsmqSecurityMode.Message; a.EnableTransaction = true; a.OrderedProcessing = true; }); var xml = ((IAdapterBindingSerializerFactory)nma).GetAdapterBindingSerializer().Serialize(); Assert.That( xml, Is.EqualTo( "<CustomProps>" + "<MaxReceivedMessageSize vt=\"3\">65535</MaxReceivedMessageSize>" + "<EnableTransaction vt=\"11\">-1</EnableTransaction>" + "<OrderedProcessing vt=\"11\">-1</OrderedProcessing>" + "<SecurityMode vt=\"8\">Message</SecurityMode>" + "<MessageClientCredentialType vt=\"8\">Windows</MessageClientCredentialType>" + "<AlgorithmSuite vt=\"8\">Basic256</AlgorithmSuite>" + "<MsmqAuthenticationMode vt=\"8\">WindowsDomain</MsmqAuthenticationMode>" + "<MsmqProtectionLevel vt=\"8\">Sign</MsmqProtectionLevel>" + "<MsmqSecureHashAlgorithm vt=\"8\">Sha1</MsmqSecureHashAlgorithm>" + "<MsmqEncryptionAlgorithm vt=\"8\">RC4Stream</MsmqEncryptionAlgorithm>" + "<MaxConcurrentCalls vt=\"3\">200</MaxConcurrentCalls>" + "<InboundBodyLocation vt=\"8\">UseBodyElement</InboundBodyLocation>" + "<InboundNodeEncoding vt=\"8\">Xml</InboundNodeEncoding>" + "<DisableLocationOnFailure vt=\"11\">0</DisableLocationOnFailure>" + "<SuspendMessageOnFailure vt=\"11\">-1</SuspendMessageOnFailure>" + "<OpenTimeout vt=\"8\">00:01:00</OpenTimeout>" + "<SendTimeout vt=\"8\">00:01:00</SendTimeout>" + "<CloseTimeout vt=\"8\">00:01:00</CloseTimeout>" + "</CustomProps>")); }
public void ValidateDoesNotThrow() { var nma = new WcfNetMsmqAdapter.Inbound( a => { a.Address = new EndpointAddress("net.msmq://localhost/private/service_queue"); a.SecurityMode = NetMsmqSecurityMode.Message; a.EnableTransaction = true; a.OrderedProcessing = true; }); Assert.That(() => ((ISupportValidation)nma).Validate(), Throws.Nothing); }