public void SerializeToXml() { var osa = new WcfSapAdapter.Outbound( a => { a.Address = new SAPConnectionUri { ApplicationServerHost = "appHost", ConnectionType = OutboundConnectionType.A, MsServ = "msServer", Group = "dialog", Client = "100", Language = "FR" }; a.AutoConfirmSentIdocs = true; a.MaxConnectionsPerSystem = 30; a.SendTimeout = TimeSpan.FromMinutes(2); a.Password = "******"; a.UserName = "******"; a.MaxConnectionsPerSystem = 30; }); var xml = ((IAdapterBindingSerializerFactory)osa).GetAdapterBindingSerializer().Serialize(); Assert.That( xml, Is.EqualTo( "<CustomProps>" + "<BindingType vt=\"8\">sapBinding</BindingType>" + "<BindingConfiguration vt=\"8\">" + "<binding name=\"sapBinding\" sendTimeout=\"00:02:00\" enableBizTalkCompatibilityMode=\"true\" maxConnectionsPerSystem=\"30\" autoConfirmSentIdocs=\"true\" />" + "</BindingConfiguration>" + "<EndpointBehaviorConfiguration vt=\"8\"><behavior name=\"EndpointBehavior\" />" + "</EndpointBehaviorConfiguration>" + "<UseSSO vt=\"11\">0</UseSSO>" + "<UserName vt=\"8\">BTS_USER</UserName>" + "<Password vt=\"8\">p@ssw0rd</Password>" + "<InboundBodyLocation vt=\"8\">UseBodyElement</InboundBodyLocation>" + "<InboundNodeEncoding vt=\"8\">Xml</InboundNodeEncoding>" + "<OutboundBodyLocation vt=\"8\">UseBodyElement</OutboundBodyLocation>" + "<OutboundXmlTemplate vt=\"8\"><bts-msg-body xmlns=\"http://www.microsoft.com/schemas/bts2007\" encoding=\"xml\"/></OutboundXmlTemplate>" + "<PropagateFaultMessage vt=\"11\">-1</PropagateFaultMessage>" + "<EnableTransaction vt=\"11\">0</EnableTransaction>" + "<IsolationLevel vt=\"8\">Serializable</IsolationLevel>" + "</CustomProps>")); }
public void ValidateDoesNotThrow() { var osa = new WcfSapAdapter.Outbound( a => { a.Address = new SAPConnectionUri { ApplicationServerHost = "appHost", ConnectionType = OutboundConnectionType.A, MsServ = "msServer", Group = "dialog", Client = "100", Language = "FR" }; a.AutoConfirmSentIdocs = true; a.MaxConnectionsPerSystem = 30; a.Password = "******"; a.UserName = "******"; a.MaxConnectionsPerSystem = 30; }); Assert.That(() => ((ISupportValidation)osa).Validate(), Throws.Nothing); }