public void BinarySearch_LinearSearch_Results_AreSame() { //Arrange var randomWords = new DownloadWords(); var selectedWords = new Program().SelectWords(randomWords).Take(1); //Act var search = new TypesOfSearches.Searches(); foreach (var word in selectedWords) { //Assert Assert.AreSame(search.BinarySearch(word), search.LinearSearch(word)); } }
public void IfLinearSearch_CantFindAMatch_ItsReturnValue_IsNull() { //Arrange var randomWords = new DownloadWords(); var selectedWords = new Program().SelectWords(randomWords).Take(1); //Act var search = new TypesOfSearches.Searches(); foreach (var word in selectedWords) { word.RandomWord = "BeastModeBarry"; //Assert Assert.IsNull(search.LinearSearch(word)); } }