public void ScrapeAerialMovesForCharacter(WebCharacter character) { var aerialMoveScrapingService = new AerialMoveScraper(_scrapingServices); character.SourceUrl = $"{Keys.KHSiteBaseUrl}{_game}{character.EscapedCharacterName}"; var aerialMoves = aerialMoveScrapingService.Scrape(character).ToList(); CollectionAssert.AllItemsAreNotNull(aerialMoves); CollectionAssert.AllItemsAreUnique(aerialMoves); CollectionAssert.IsNotEmpty(aerialMoves); aerialMoves.ForEach(move => { AssertMoveIsValid(move, character); Assert.That(move.LandingLag, Is.Not.Null); Assert.That(move.AutoCancel, Is.Not.Null); }); }
public void SetUp() { var instanceIdGenerator = new InstanceIdGenerator(); _htmlParserProvider = new DefaultHtmlParserProvider(); _movementProvider = new DefaultMovementProvider(instanceIdGenerator); _moveProvider = new DefaultMoveProvider(instanceIdGenerator); _pageDownloader = new DefaultPageDownloader(); _webClientProvider = new DefaultWebClientProvider(); _attributeProvider = new DefaultAttributeProvider(instanceIdGenerator); _imageScrapingProvider = new DefaultImageScrapingProvider(); _imageScrapingService = new DefaultImageScrapingService(_imageScrapingProvider); _uniqueDataProvider = new DefaultUniqueDataProvider(instanceIdGenerator); _webServices = new DefaultWebServices(_htmlParserProvider, _webClientProvider, _pageDownloader); _attributeScrapingServices = new DefaultAttributeScrapingServices(_attributeProvider, _webServices); _moveScrapingServices = new DefaultMoveScrapingServices(_moveProvider, _webServices); _movementScrapingServices = new DefaultMovementScrapingServices(_movementProvider, _webServices); _uniqueDataScrapingServices = new DefaultUniqueDataScrapingServices(_uniqueDataProvider, _webServices); _groundMoveScraper = new GroundMoveScraper(_moveScrapingServices); _aerialMoveScraper = new AerialMoveScraper(_moveScrapingServices); _specialMoveScraper = new SpecialMoveScraper(_moveScrapingServices); _throwMovesScraper = new ThrowMoveScraper(_moveScrapingServices); _characterMoveScraper = new DefaultCharacterMoveScraper(new List <IMoveScraper> { _groundMoveScraper, _aerialMoveScraper, _specialMoveScraper, _throwMovesScraper }); var attributeScrapers = new List <IAttributeScraper> { new AirSpeedScraper(_attributeScrapingServices), new AirDodgeScraper(_attributeScrapingServices) }; _movementScraper = new DefaultMovementScraper(_movementScrapingServices); _characterDataScrapingServices = new DefaultCharacterDataScrapingServices(_imageScrapingService, _movementScraper, attributeScrapers, _characterMoveScraper, _uniqueDataScrapingServices, _webServices, instanceIdGenerator); _characterDataScraper = new DefaultCharacterDataScraper(_characterDataScrapingServices); }
public DefaultCharacterDataScraper MakeCharacterDataScraper() { var instanceIdGenerator = new InstanceIdGenerator(); _htmlParserProvider = new DefaultHtmlParserProvider(); _movementProvider = new DefaultMovementProvider(instanceIdGenerator); _moveProvider = new DefaultMoveProvider(instanceIdGenerator); _pageDownloader = new DefaultPageDownloader(); _webClientProvider = new DefaultWebClientProvider(); _attributeProvider = new DefaultAttributeProvider(instanceIdGenerator); _imageScrapingProvider = new DefaultImageScrapingProvider(); _imageScrapingService = new DefaultColorScrapingService(_characterCss); //_imageScrapingProvider); _uniqueDataProvider = new DefaultUniqueDataProvider(instanceIdGenerator); _webServices = new DefaultWebServices(_htmlParserProvider, _webClientProvider, _pageDownloader); _attributeScrapingServices = new DefaultAttributeScrapingServices(_attributeProvider, _webServices); _moveScrapingServices = new DefaultMoveScrapingServices(_moveProvider, _webServices); _movementScrapingServices = new DefaultMovementScrapingServices(_movementProvider, _webServices); _uniqueDataScrapingServices = new DefaultUniqueDataScrapingServices(_uniqueDataProvider, _webServices); _groundMoveScraper = new GroundMoveScraper(_moveScrapingServices); _aerialMoveScraper = new AerialMoveScraper(_moveScrapingServices); _specialMoveScraper = new SpecialMoveScraper(_moveScrapingServices); _throwMoveScraper = new ThrowMoveScraper(_moveScrapingServices); _characterMoveScraper = new DefaultCharacterMoveScraper(new List <IMoveScraper> { _groundMoveScraper, _aerialMoveScraper, _specialMoveScraper, _throwMoveScraper }); var attributeScrapers = AttributeScrapers.AllWithScrapingServices(_attributeScrapingServices, _urlUnderTest); _movementScraper = new DefaultMovementScraper(_movementScrapingServices); _characterDataScrapingServices = new DefaultCharacterDataScrapingServices(_imageScrapingService, _movementScraper, attributeScrapers, _characterMoveScraper, _uniqueDataScrapingServices, _webServices, instanceIdGenerator); return(new DefaultCharacterDataScraper(_characterDataScrapingServices)); }