private SyncResponse GetSubstituteMailItem(string folderID, string threadTopic)
{
int counter = 0;
int waitTime = int.Parse(Common.GetConfigurationPropertyValue("WaitTime", this.Site));
int retryCount = int.Parse(Common.GetConfigurationPropertyValue("RetryCount", this.Site));
SyncResponse syncResult = this.SyncChanges(folderID);
string serverID = TestSuiteBase.FindServerId(syncResult, "ThreadTopic", threadTopic);
while (serverID == null && counter < retryCount)
{
Thread.Sleep(waitTime);
syncResult = this.SyncChanges(folderID);
if (syncResult.ResponseDataXML != null)
{
serverID = TestSuiteBase.FindServerId(syncResult, "ThreadTopic", threadTopic);
}
counter++;
}
Site.Assert.IsNotNull(serverID, "The email item with subject '{0}' should be found.", threadTopic);
Site.Log.Add(LogEntryKind.Debug, "Find item successful Loop count {0}", counter);
return syncResult;
}