public void MakingQueryWithOneProgrammingLanguageReturnsValidSearchResults() { //Arrange var fakeSearchEngines = ReturnSearchEnginesMocks(); var queryMaker = new QueryMaker(fakeSearchEngines); //Act var searchResults = queryMaker.QuerySearchEngines(new string[] { "java script" }); //Assert var numberOfSearchEngines = fakeSearchEngines.Count(); Assert.AreEqual(numberOfSearchEngines, searchResults.Count()); AssertAreValidSearchResults(searchResults, numberOfSearchEngines, "java script"); AssertNumberOfResutsGreaterOrEqualThanZero(searchResults); }
public void MakingQueryWithMultipleProgrammingLanguagesReturnsValidSearchResults() { //Arrange var fakeSearchEngines = ReturnSearchEnginesMocks(); var queryMaker = new QueryMaker(fakeSearchEngines); //Act var programmingLanguages = new string[] { "java script", "c#", "Ruby on Rails", "Visual Basic", ".net" }; var searchResults = queryMaker.QuerySearchEngines(programmingLanguages); //Assert var numberOfSearchEngines = fakeSearchEngines.Count(); Assert.AreEqual(5 * numberOfSearchEngines, searchResults.Count()); foreach (var programmingLanguage in programmingLanguages) { AssertAreValidSearchResults(searchResults, numberOfSearchEngines, programmingLanguage); } AssertNumberOfResutsGreaterOrEqualThanZero(searchResults); }