public SearchManagerTests()
 {
     _searchManager = SearchManagerFactory.CreateSearchManager();
     _queries       = new List <string> {
         ".net", "java"
     };
     _searchResults = new List <SearchResult>
     {
         new SearchResult
         {
             Query        = ".net",
             SearchClient = "Google",
             TotalResults = 4450000000
         },
         new SearchResult
         {
             Query        = ".net",
             SearchClient = "MSN Search",
             TotalResults = 1235442
         },
         new SearchResult
         {
             Query        = "java",
             SearchClient = "Google",
             TotalResults = 96600000
         },
         new SearchResult
         {
             Query        = "java",
             SearchClient = "MSN Search",
             TotalResults = 9438148
         },
     };
 }
Esempio n. 2
0
        private static async Task Main(string[] args)
        {
            try
            {
                if (args.Length == 0)
                {
                    Console.WriteLine("There mush be one argument at least, please try again !");
                    return;
                }

                Console.WriteLine("Processing results ...");
                var searchManager = SearchManagerFactory.CreateSearchManager();
                var result        = await searchManager.GetSearchReportAsync(args?.ToList());

                Console.Clear();
                Console.WriteLine(result);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred while processing your request: {ex.Message}");
                return;
            }
            Console.ReadKey();
        }