/// <summary>
        /// Returns a Service.GoogleSearchResult data set that is valid
        /// according to web service guidelines
        /// </summary>
        /// <param name="pageSize">page size of the Service.GoogleSearchResult set</param>
        /// <returns>Service.GoogleSearchResult instance with Service.resultElement
        /// entries present according to page size</returns>
        public static Service.GoogleSearchResult GetGoogleSearchResults(int pageSize)
        {
            Service.GoogleSearchResult result = new Service.GoogleSearchResult();

            result.estimatedTotalResultsCount = TotalResultsCount;
            result.estimateIsExact            = true;
            result.documentFiltering          = false;
            result.startIndex             = 1;
            result.endIndex               = pageSize;
            result.searchTime             = 0.09;
            result.searchQuery            = "Result Control";
            result.searchComments         = "";
            result.searchTips             = "";
            result.directoryCategories    = new Service.DirectoryCategory[1];
            result.directoryCategories[0] = ResultDummyDataSource.GetDirectoryCategory();

            // fill up 10 result elements
            result.resultElements = new Service.ResultElement[pageSize];
            for (int i = 0; i < pageSize; i++)
            {
                result.resultElements[i] = GetResultElement(i);
            }

            return(result);
        }
 /// <summary>
 /// Returns a valid Service.ResultElement instance
 /// </summary>
 /// <param name="index">Index to help create title and url</param>
 /// <returns>Fully populated Service.ResultElement instance</returns>
 public static Service.ResultElement GetResultElement(int index)
 {
     Service.ResultElement elem = new Service.ResultElement();
     elem.title      = "Result Control " + index;
     elem.URL        = "http://apress.com/resultcontrol" + index;
     elem.summary    = "Summary";
     elem.snippet    = "Snippet";
     elem.hostName   = "apress";
     elem.cachedSize = "2k";
     elem.relatedInformationPresent = false;
     elem.directoryTitle            = "Test";
     elem.directoryCategory         = ResultDummyDataSource.GetDirectoryCategory();
     return(elem);
 }