public async void SetKeywords_UrlCorrect() { var url = "http://www.wp.pl"; var logger = Substitute.For <ILogger <Tools.HeaderAnalyzer> >(); var headerAnalyzer = new Tools.HeaderAnalyzer(logger); await headerAnalyzer.SetKeywords(url); Assert.NotNull(headerAnalyzer.Keywords); }
public async void SetKeywords_UrlIncorrect() { var url = "www.wp.pl"; //Url is incorrect 'caused by passing it without protocol var logger = Substitute.For <ILogger <Tools.HeaderAnalyzer> >(); var headerAnalyzer = new Tools.HeaderAnalyzer(logger); await headerAnalyzer.SetKeywords(url); Assert.Null(headerAnalyzer.Keywords); }
public async void CountKeywordsOccurences_UrlIncorrect() { var url = "www.wp.pl"; var logger = Substitute.For <ILogger <Tools.HeaderAnalyzer> >(); var headerAnalyzer = new Tools.HeaderAnalyzer(logger); await headerAnalyzer.SetKeywords(url); var result = await headerAnalyzer.CountKeywordsOccurences(url); Assert.Null(result); }