Microsoft.Protocols.TestSuites.MS_ASCMD.S09_MeetingResponse.GetSubstituteMailItem C# (CSharp) Method

GetSubstituteMailItem() private method

Get email with special threadTopic
private GetSubstituteMailItem ( string folderID, string threadTopic ) : SyncResponse
folderID string The folderID that store mail items
threadTopic string The thread topic
return SyncResponse
        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;
        }