コード例 #1
0
        public void SearchFight_ValidQueryList_ReturnResultWithData()
        {
            //Arrange
            _googleSearchEngineApiClientBuilder.WithSearchReturns200OK();
            _bingSearchEngineApiClientBuilder.WithSearchReturns200OK();

            //Act
            var result = _service.SearchFight(new List <string> {
                "query test 1", "query test 2"
            });

            //Assert
            result.QueriesResults.Count.Should().Be(2);
            result.QueriesResults.First().GoogleTotalResults.Should().Be(992);
            result.QueriesResults.First().BingTotalResults.Should().Be(40);
            result.GoogleWinner.Should().Be("query test 1");
            result.BingWinner.Should().Be("query test 2");
            result.TotalWinner.Should().Be("query test 1");
        }