Ejemplo n.º 1
0
        /// <summary>
        /// Finds the position of the SearchSite in the search engines query
        /// </summary>
        public async Task RunGetURLPositionAsync()
        {
            SearchEngine       searchEngine       = SearchEnigineType.GetSearchEngine(SearchEngine);
            SearchEngineReader searchEngineReader = new SearchEngineReader(SearchPhrase, searchEngine);

            string searchResult = await Task.Run(() => { return(searchEngineReader.GetSearchEngineResults()); });

            SearchEngineResultSearcher searchEngineResultSearcher = new SearchEngineResultSearcher(SearchSite, searchResult, searchEngine);

            IEnumerable <string> searchPositions = searchEngineResultSearcher.FindPositionOfSearchString();

            Result = string.Join(",", searchPositions);
        }
Ejemplo n.º 2
0
        public void SendCommandToSearchEngine_SearchResultsIsReturned()
        {
            bool resultReturned = false;
            SearchEngineReader searchEngineReader = new SearchEngineReader(TestHelp.SearchSite, TestHelp.SearchEngine);

            string result = searchEngineReader.GetSearchEngineResults();

            if (!String.IsNullOrEmpty(result))
            {
                resultReturned = true;
            }

            Assert.AreEqual(true, resultReturned);
        }