示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }