#副標=商務處理與整合 (7) #大標=BizTalk解決方案的自動測試 #眉標=BizTalk Server 2006 #作者=文/彭靖灝 #引言= ========box 程式1========= ..\..\..\Receive\ *.xml ..\..\..\Send\ *.xml 1 server=(local);Trusted_Connection=yes;    database=SQLAdapterUsingDTCOrderDB DELETE ORDERS 1 server=(local);Trusted_Connection=yes;   database=SQLAdapterUsingDTCCustomerDB DELETE CUSTOMERS    ===========end========== =======box 程式2========  ..\..\..\Test\TestData\OrderValidSample.xml  ..\..\..\Receive\OrderValid.xml  10000  ..\..\..\Send\  *.xml  true    ..\..\..\Test\TestData\OrderDetail.xsd http://Microsoft.Samples.BizTalk.Orchestrations.SQLAdapterUsingDTC.BizTalkApp 4 server=(local);Trusted_Connection=yes;database=SQLAdapterUsingDTCCustomerDB select * from Customers where CustomerID = '{0}' 1 1 1 server=(local);  Trusted_Connection=yes;database=SQLAdapterUsingDTCOrderDB   select * from Orders where OrderID = '{0}' 1 1 ============end============= ==========box 程式3============ using System; using System.Text; using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Services.BizTalkApplicationFramework.BizUnit; namespace SQLAdapterUsingDTC.Test { [TestClass] public class BizTalkAppTest { /// /// It runs a valid test for the SQLAdapterAtomicTx orchestration. /// [TestMethod] public void SqlAdapterValidTest() { BizUnit bizUnit = new BizUnit (@"..\..\..\Test\TestCases\SQLAdapterValidTest.xml"); bizUnit.RunTest(); } /// /// It runs an invalid test for the SQLAdapterAtomicTx orchestration. /// [TestMethod] [ExpectedException(typeof(System.IndexOutOfRangeException), "The service instance must be suspended because the serviced compnent tried    to insert a recored having a duplicate public key")] public void SqlAdapterInvalidTest() { BizUnit bizUnit = new BizUnit    (@"..\..\..\Test\TestCases\SQLAdapterInvalidTest.xml"); bizUnit.RunTest(); } } } ============end============