我想將一些BizTalk 2006 R2幫助程序代碼轉換爲BizTalk 2010,我遇到了一個特殊問題。我試圖單元測試,從2006 R2有一個破API變化的方法 - > 2010年和我不斷收到以下情況例外,當我嘗試訪問黨的批次:Biztalk 2010 X12 EDI方
System.Data.SqlClient.SqlException: Could not find stored procedure 'edi_PartnerBatchScheduleSelect'.
代碼:
[TestMethod()]
public void GetPartyBatchStatusTest()
{
Assert.IsTrue(GetPartyBatchStatus("Party1"));
}
public bool GetPartyBatchStatus(string PartyName)
{
if (string.IsNullOrEmpty(PartyName))
{
// Throw Exception
throw new System.ArgumentException("Parameter PartyName cannot be null or empty in the GetPartyBatchStatus method.", "PartyName");
}
bool RetVal = false;
Partner objPartner = new Partner(PartyName);
if (objPartner.PartyId != -1)
{
foreach (IPartnerBatch batch in objPartner.Batches.Batches)
{
RetVal = batch.BatchingActivated;
}
}
return RetVal;
}
對於這個測試案例,我建立了一個Party1和一個Party2並在它們之間啓動了一個批處理。
BizTalkHelper類是從Biztalk工作流中調用的不相關的輔助方法的集合。其中有一堆,但這是唯一需要改變才能在2010年大會上進行編輯的。 – messenger 2011-02-14 18:44:48