Esempio n. 1
0
        /// <summary>
        /// Search calendars using the given keyword text
        /// </summary>
        /// <param name="searchRequest">The request for Search command</param>
        /// <returns>The search data returned from the server</returns>
        public SearchStore Search(SearchRequest searchRequest)
        {
            SearchResponse response       = this.activeSyncClient.Search(searchRequest);
            SearchStore    searchResponse = Common.LoadSearchResponse(response, Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site));

            this.VerifyTransport();
            this.VerifySearchCommandResponse(searchResponse);

            return(searchResponse);
        }
        /// <summary>
        /// Search calendars using the given keyword text
        /// </summary>
        /// <param name="searchRequest">The request for Search command</param>
        /// <returns>The search data returned from the server</returns>
        public SearchStore Search(SearchRequest searchRequest)
        {
            SearchResponse response       = this.activeSyncClient.Search(searchRequest);
            SearchStore    searchResponse = Common.LoadSearchResponse(response);

            this.VerifyTransport();
            this.VerifySearchCommandResponse(searchResponse);

            return(searchResponse);
        }
        /// <summary>
        /// This method is used to verify the Search response related requirements.
        /// </summary>
        /// <param name="searchResponse">Specified SearchStore result returned from the server</param>
        private void VerifySearchCommandResponse(SearchStore searchResponse)
        {
            Site.Assert.IsNotNull(searchResponse.Results, "Search results should not be null.");

            foreach (SearchItem itemInSearch in searchResponse.Results)
            {
                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCAL_R534");

                // Verify MS-ASCAL requirement: MS-ASCAL_R534
                // If the calendar class exists, then any of its elements can be included, so this requirement can be captured.
                Site.CaptureRequirementIfIsNotNull(
                    itemInSearch.Calendar,
                    534,
                    @"[In Search Command Response] Any of the elements that belong to the Calendar class, as specified in section 2.2.2, can be included in a Search command response.");

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCAL_R535");

                // Since R534 is captured, then this requirement can be captured too.
                // If schema is verified successfully, this requirement can be captured
                Site.CaptureRequirement(
                    535,
                    @"[In Search Command Response] Top-level Calendar class elements MUST be returned as child elements of the search:Properties element ([MS-ASCMD] section 2.2.3.128) in the Search command response.");
            }
        }