public void SerializeToXml() { var osa = new WcfSqlAdapter.Outbound( a => { a.Address = new SqlAdapterConnectionUri { InboundId = "AvailableBatches", Server = "localhost", InitialCatalog = "BizTalkFactoryTransientStateDb" }; a.IsolationLevel = IsolationLevel.ReadCommitted; a.OutboundBodyLocation = OutboundMessageBodySelection.UseBodyElement; a.PropagateFaultMessage = true; a.SendTimeout = TimeSpan.FromMinutes(2); a.StaticAction = "TypedProcedure/dbo/usp_batch_AddPart"; }); var xml = ((IAdapterBindingSerializerFactory)osa).GetAdapterBindingSerializer().Serialize(); Assert.That( xml, Is.EqualTo( "<CustomProps>" + "<BindingType vt=\"8\">sqlBinding</BindingType>" + "<BindingConfiguration vt=\"8\">" + "<binding name=\"sqlBinding\" sendTimeout=\"00:02:00\" />" + "</BindingConfiguration>" + "<EndpointBehaviorConfiguration vt=\"8\"><behavior name=\"EndpointBehavior\" />" + "</EndpointBehaviorConfiguration>" + "<StaticAction vt=\"8\">TypedProcedure/dbo/usp_batch_AddPart</StaticAction>" + "<UseSSO vt=\"11\">0</UseSSO>" + "<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\">-1</EnableTransaction>" + "<IsolationLevel vt=\"8\">ReadCommitted</IsolationLevel>" + "</CustomProps>")); }
public void ValidateDoesNotThrow() { var osa = new WcfSqlAdapter.Outbound( a => { a.Address = new SqlAdapterConnectionUri { InboundId = "AvailableBatches", Server = "localhost", InitialCatalog = "BizTalkFactoryTransientStateDb" }; a.IsolationLevel = IsolationLevel.ReadCommitted; a.OutboundBodyLocation = OutboundMessageBodySelection.UseBodyElement; a.PropagateFaultMessage = true; a.StaticAction = "TypedProcedure/dbo/usp_batch_AddPart"; }); Assert.That(() => ((ISupportValidation)osa).Validate(), Throws.Nothing); }