protected DataStructures.ItemOperations GetItemOperationsResult(string collectionId, string serverId, string fileReference, Request.BodyPreference[] bodyPreferences, Request.BodyPartPreference[] bodyPartPreferences, DeliveryMethodForFetch? deliveryMethod)
{
DataStructures.ItemOperations item = null;
ItemOperationsRequest request = TestSuiteHelper.CreateItemOperationsRequest(collectionId, serverId, fileReference, bodyPreferences, bodyPartPreferences);
int counter = 0;
int waitTime = int.Parse(Common.GetConfigurationPropertyValue("WaitTime", this.Site));
int retryCount = int.Parse(Common.GetConfigurationPropertyValue("RetryCount", this.Site));
do
{
Thread.Sleep(waitTime);
DataStructures.ItemOperationsStore itemOperationsStore = this.ASAIRSAdapter.ItemOperations(request, deliveryMethod ?? DeliveryMethodForFetch.Inline);
// Since the item serverId or attachment fileReference is unique, there should be only one item in response
this.Site.Assert.AreEqual<int>(
1,
itemOperationsStore.Items.Count,
"The count of Items in ItemOperations command response should be 1.");
if (itemOperationsStore.Items[0].Email != null)
{
item = itemOperationsStore.Items[0];
}
}
while (item == null && counter < retryCount);
this.Site.Assert.IsNotNull(item, "The item should be found, retry count: {0}.", counter);
return item;
}