/// <summary>
/// Search item with specified criteria on the server.
/// </summary>
/// <param name="subject">The subject of the item.</param>
/// <param name="collectionId">The collection id.</param>
/// <param name="conversationId">The conversation for which to search.</param>
/// <param name="bodyPreferences">The bodyPreference in the options element.</param>
/// <param name="bodyPartPreferences">The bodyPartPreference in the options element.</param>
/// <returns>The server response.</returns>
protected DataStructures.Search GetSearchResult(string subject, string collectionId, string conversationId, Request.BodyPreference[] bodyPreferences, Request.BodyPartPreference[] bodyPartPreferences)
{
SearchRequest request = TestSuiteHelper.CreateSearchRequest(subject, collectionId, conversationId, bodyPreferences, bodyPartPreferences);
DataStructures.SearchStore searchStore = this.ASAIRSAdapter.Search(request);
DataStructures.Search searchItem = null;
if (searchStore.Results.Count != 0)
{
searchItem = TestSuiteHelper.GetSearchItem(searchStore, subject);
}
this.Site.Assert.IsNotNull(searchItem, "The email message with subject {0} should be found.", subject);
return(searchItem);
}