public UniqueDataScrapersTests()
 {
     instanceIdGenerator = new InstanceIdGenerator();
     htmlParserProvider  = new DefaultHtmlParserProvider();
     pageDownloader      = new DefaultPageDownloader();
     webClientProvider   = new DefaultWebClientProvider();
     webServices         = new DefaultWebServices(htmlParserProvider, webClientProvider, pageDownloader);
     uniqueDataProvider  = new DefaultUniqueDataProvider(instanceIdGenerator);
     scrapingServices    = new DefaultUniqueDataScrapingServices(uniqueDataProvider, webServices);
 }
        public static DefaultMoveScrapingServices MakeDefaultMoveScrapingServices()
        {
            var instanceIdGenerator = new InstanceIdGenerator();
            var htmlParserProvider  = new DefaultHtmlParserProvider();
            var moveProvider        = new DefaultMoveProvider(instanceIdGenerator);
            var pageDownloader      = new DefaultPageDownloader();
            var webClientProvider   = new DefaultWebClientProvider();
            var webServices         = new DefaultWebServices(htmlParserProvider, webClientProvider, pageDownloader);

            return(new DefaultMoveScrapingServices(moveProvider, webServices));
        }
Пример #3
0
        public async Task PullsExpectedColorForCharacter(string characterName, string expectedColor)
        {
            string css = new DefaultPageDownloader()
                         .DownloadPageSource(new Uri("https://kuroganehammer.com/css/character.css"),
                                             new DefaultWebClientProvider());

            var    sut         = new DefaultColorScrapingService(css);
            string actualColor = await sut.GetColorHexValue(characterName);

            Assert.That(actualColor.ToLower(), Is.EqualTo(expectedColor.ToLower()));
        }
Пример #4
0
        public void SetUp()
        {
            var instanceIdGenerator = new InstanceIdGenerator();
            var htmlParserProvider  = new DefaultHtmlParserProvider();
            var movementProvider    = new DefaultMovementProvider(instanceIdGenerator);
            var pageDownloader      = new DefaultPageDownloader();
            var webClientProvider   = new DefaultWebClientProvider();
            var webServices         = new DefaultWebServices(htmlParserProvider, webClientProvider, pageDownloader);

            _scrapingServices = new DefaultMovementScrapingServices(movementProvider, webServices);
        }
Пример #5
0
        private static DefaultAttributeScrapingServices MakeAttributeScrapingServices()
        {
            var instanceIdGenerator = new InstanceIdGenerator();
            var htmlParserProvider  = new DefaultHtmlParserProvider();
            var attributeProvider   = new DefaultAttributeProvider(instanceIdGenerator);
            var pageDownloader      = new DefaultPageDownloader();
            var webClientProvider   = new DefaultWebClientProvider();
            var webServices         = new DefaultWebServices(htmlParserProvider, webClientProvider, pageDownloader);
            var scrapingServices    = new DefaultAttributeScrapingServices(attributeProvider, webServices);

            return(scrapingServices);
        }