public CrawlerCommandHandlerTest()
        {
            mockArticles = new Mock <IArticles>();
            mockArticles.Setup(s => s.Add(It.IsAny <IEnumerable <Article> >())).Returns(Task.CompletedTask);
            mockArticles.Setup(s => s.AnyWithDate(It.IsAny <DateTime>())).ReturnsAsync(false);

            var mochHttpHandler = new Mock <IMorningBrewClient>();

            mochHttpHandler.Setup(s => s.GetPageAsync(1)).ReturnsAsync(ReadTextFromHtml.FromHtmlFile("morningbrew06072018.html"));

            handler = new CrawlerCommandHandler(mochHttpHandler.Object, mockArticles.Object);
        }
        public MorningBrewMultipleAuthorsTest()
        {
            string page = ReadTextFromHtml.FromHtmlFile("morningbrew04072018.html");

            article = GetArticleWithMultipleAuthors(page);
        }
Exemple #3
0
        public MorningBrewProcessorTest()
        {
            string page = ReadTextFromHtml.FromHtmlFile("morningbrew12072018.html");

            articles = GetArticles(page);
        }