我正在尝试将一些 BizTalk 2006 R2 帮助程序代码转换为 BizTalk 2010,但遇到了一个特殊问题。我正在尝试对一个从 2006 R2 -> 2010 有重大 API 更改的方法进行单元测试,当我尝试访问聚会的批次时,我不断收到以下异常:
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 并在它们之间开始了一个批处理。