public void GetKeywords_ValidUrl_ReturnKeywords() { _testObject = new WebPageAdapter(); var keywords = _testObject.GetKeywords(ValidUrl); Assert.IsTrue(keywords.Count > 0); }
public void GetKeywords_InvalidUrl_ReturnNull() { _testObject = new WebPageAdapter(); var keywords = _testObject.GetKeywords(InvalidUrl); Assert.IsNull(keywords); }
public void IsUrlValid_ValidUrl_ReturnTrue() { _testObject = new WebPageAdapter(); var isUrlValid = _testObject.IsUrlValid(ValidUrl); Assert.IsTrue(isUrlValid); }
public void IsUrlValid_InvalidUrl_ReturnFalse() { _testObject = new WebPageAdapter(); var isUrlValid = _testObject.IsUrlValid(InvalidUrl); Assert.IsFalse(isUrlValid); }
public void GetKeywordOccurrences_InValidUrl_ReturnZero() { var searchedKeyword = "wakacje Rogowo"; var expectedKeywordOccurrences = 0; _testObject = new WebPageAdapter(); var keywordOccurrences = _testObject.GetKeywordOccurrences(searchedKeyword, InvalidUrl); Assert.IsTrue(keywordOccurrences == expectedKeywordOccurrences); }
public void GetKeywordOccurrences_ValidUrlAndKeyword_ReturnNumberOfOccurrence() { var searchedKeyword = "wakacje Rogowo"; var expectedKeywordOccurrences = 3; _testObject = new WebPageAdapter(); var keywordOccurrences = _testObject.GetKeywordOccurrences(searchedKeyword, ValidUrl); Assert.IsTrue(keywordOccurrences == expectedKeywordOccurrences); }
public void GetKeywordOccurrences_ValidUrlAndInvalidKeyword_ReturnZero() { var searchedKeyword = "wakacje Kolobrzeg"; var expectedKeywordOccurrences = 0; _testObject = new WebPageAdapter(); var keywordOccurrences = _testObject.GetKeywordOccurrences(searchedKeyword, ValidUrl); Assert.IsTrue(keywordOccurrences == expectedKeywordOccurrences); }
public void GetKeywordsOccurrences_InvalidUrl_ReturnNull() { var searchedKeywords = new List <string>(); searchedKeywords.Add("wakacje Rogowo"); searchedKeywords.Add("wakacje nad morzem"); _testObject = new WebPageAdapter(); var keywordOccurrences = _testObject.GetKeywordsOccurrences(searchedKeywords, InvalidUrl); Assert.IsNull(keywordOccurrences); }
public void GetKeywordsOccurrences_ValidUrl_ReturnListOfKeywordDtoWithOccurrences() { var searchedKeywords = new List <string>(); searchedKeywords.Add("wakacje Rogowo"); searchedKeywords.Add("wakacje nad morzem"); _testObject = new WebPageAdapter(); var keywordOccurrences = _testObject.GetKeywordsOccurrences(searchedKeywords, ValidUrl); Assert.IsTrue(keywordOccurrences.Count > 0); Assert.IsTrue(keywordOccurrences.Any(keyword => keyword.OccurenceCount > 0)); }
private void Init() { _webPageAdapter = new WebPageAdapter(); }