Ejemplo n.º 1
0
        public void CalculateWinnerPerSearchEngine_ShouldReturnDotNetAsWinnerForYahoo()
        {
            //Arrange
            IWebRequest    webRequest     = new WebRequestImplementation();
            SearchExecutor searchExecutor = new SearchExecutor(webRequest);
            Report         yahooReport1   = new Report()
            {
                SearchEngine = SearchEngineEnum.Yahoo.ToString(), Keyword = ".net", Quantity = 65
            };
            Report yahooReport2 = new Report()
            {
                SearchEngine = SearchEngineEnum.Yahoo.ToString(), Keyword = "java", Quantity = 50
            };

            //Act
            searchExecutor.reports.Add(yahooReport1);
            searchExecutor.reports.Add(yahooReport2);
            var result = searchExecutor.CalculateWinnerPerSearchEngine(SearchEngineEnum.Yahoo);

            //Assert
            result.Should().Be("Yahoo winner: .net");
        }
Ejemplo n.º 2
0
        public void CalculateWinnerPerSearchEngine_ShouldReturnDotNetAsWinnerForGoogle()
        {
            //Arrange
            IWebRequest    webRequest     = new WebRequestImplementation();
            SearchExecutor searchExecutor = new SearchExecutor(webRequest);
            Report         googleReport1  = new Report()
            {
                SearchEngine = SearchEngineEnum.Google.ToString(), Keyword = ".net", Quantity = 999
            };
            Report googleReport2 = new Report()
            {
                SearchEngine = SearchEngineEnum.Google.ToString(), Keyword = "java", Quantity = 758
            };

            //Act
            searchExecutor.reports.Add(googleReport1);
            searchExecutor.reports.Add(googleReport2);
            var result = searchExecutor.CalculateWinnerPerSearchEngine(SearchEngineEnum.Google);

            //Assert
            result.Should().Be("Google winner: .net");
        }