GetSearchItem() static private method

Get the email item from the Search response by using the subject as the search criteria.
static private GetSearchItem ( Microsoft.Protocols.TestSuites.Common.DataStructures searchStore, string subject ) : Search
searchStore Microsoft.Protocols.TestSuites.Common.DataStructures The Search command result.
subject string The email subject.
return Microsoft.Protocols.TestSuites.Common.DataStructures.Search
Example #1
0
        /// <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);
        }