public void ValidateDoesNotThrow() { var isa = new WcfSapAdapter.Inbound( a => { a.Address = new SAPConnectionUri { ApplicationServerHost = "appHost", ConnectionType = OutboundConnectionType.A, Client = "100", Language = "FR", ListenerGwHost = "gwHost", ListenerGwServ = "gwServer", ProgramId = "listenerProgramId" }; a.CredentialType = CredentialSelection.UserAccount; a.Password = "******"; a.UserName = "******"; a.MaxConnectionsPerSystem = 30; a.ReceiveTimeout = TimeSpan.MaxValue; a.TidDatabaseConnectionString = new SqlConnectionStringBuilder { DataSource = "localhost", InitialCatalog = "BizTalkFactoryTransientStateDb", IntegratedSecurity = true }.ToString(); }); Assert.That(() => ((ISupportValidation)isa).Validate(), Throws.Nothing); }
public void SerializeToXml() { var isa = new WcfSapAdapter.Inbound( a => { a.Address = new SAPConnectionUri { ApplicationServerHost = "appHost", ConnectionType = OutboundConnectionType.A, Client = "100", Language = "FR", ListenerGwHost = "gwHost", ListenerGwServ = "gwServer", ProgramId = "listenerProgramId" }; a.CredentialType = CredentialSelection.UserAccount; a.Password = "******"; a.UserName = "******"; a.MaxConnectionsPerSystem = 30; a.ReceiveTimeout = TimeSpan.MaxValue; a.TidDatabaseConnectionString = new SqlConnectionStringBuilder { DataSource = "localhost", InitialCatalog = "BizTalkFactoryTransientStateDb", IntegratedSecurity = true }.ToString(); }); var xml = ((IAdapterBindingSerializerFactory)isa).GetAdapterBindingSerializer().Serialize(); Assert.That( xml, Is.EqualTo( "<CustomProps>" + "<BindingType vt=\"8\">sapBinding</BindingType>" + "<BindingConfiguration vt=\"8\">" + "<binding name=\"sapBinding\" " + "receiveTimeout=\"Infinite\" " + "enableBizTalkCompatibilityMode=\"true\" " + "tidDatabaseConnectionString=\"Data Source=localhost;Initial Catalog=BizTalkFactoryTransientStateDb;Integrated Security=True\" " + "maxConnectionsPerSystem=\"30\" />" + "</BindingConfiguration>" + "<ServiceBehaviorConfiguration vt=\"8\"><behavior name=\"ServiceBehavior\" /></ServiceBehaviorConfiguration>" + "<EndpointBehaviorConfiguration vt=\"8\"><behavior name=\"EndpointBehavior\" />" + "</EndpointBehaviorConfiguration>" + "<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>" + "<DisableLocationOnFailure vt=\"11\">0</DisableLocationOnFailure>" + "<SuspendMessageOnFailure vt=\"11\">-1</SuspendMessageOnFailure>" + "<IncludeExceptionDetailInFaults vt=\"11\">-1</IncludeExceptionDetailInFaults>" + "<CredentialType vt=\"8\">UserAccount</CredentialType>" + "<UserName vt=\"8\">BTS_USER</UserName>" + "<Password vt=\"8\">p@ssw0rd</Password>" + "<OrderedProcessing vt=\"11\">0</OrderedProcessing>" + "</CustomProps>")); }