Пример #1
0
 public HtmlEngine(HtmlScrapper scrapper, int threads = 10)
 {
     _scrapper        = scrapper;
     _linkSite        = new LinkSiteFileWriter();
     _throttler       = new SemaphoreSlim(initialCount: threads);
     _htmlLinkHandler = new HtmlLinkHandler(_scrapper);
 }
Пример #2
0
        public void GivenInValidLink_WhenIsValidLinkExecuted_ShouldReturnFalse()
        {
            //Arrange
            var scrapper        = new MockHtmlScrapper();
            var htmlLinkHandler = new HtmlLinkHandler(scrapper)
            {
            };
            //Act
            var validlink = "/unknown/thisisatest";
            var result    = htmlLinkHandler.IsValidLink(validlink);

            //Assert
            Assert.False(result);
        }