public void Init() { _htmlWrapper = MockRepository.GenerateMock<IHtmlWebWrapper>(); _log = MockRepository.GenerateMock<ILog>(); _extractionArgs = MockRepository.GenerateMock<IExtractionArguments>(); _extractionResults = MockRepository.GenerateMock<IExtractionResults>(); _pageScraper = MockRepository.GenerateMock<IAutoTraderZaPageScraper>(); _pageScraper.Stub(p => p.Scrape(Arg<IExtractionArguments>.Is.Anything, Arg<HtmlDocument>.Is.Anything)).Return(new List<IVehicle>()); _extractionResults.Stub(p => p.Vehicles).Return(new List<IVehicle>()); _dummyUri = new Uri("http://dummyUrl.com"); _dummyFirstDocument = new HtmlDocument(); _extractorEngine = new AutoTraderExtractionEngine(_htmlWrapper, _log, _pageScraper); }
private static void Init() { log4net.Config.XmlConfigurator.Configure(); _log = LogManager.GetLogger(typeof(Program)); _htmlWebWrapper = new HtmlWebWrapper(_log); _japaneseHtmlWebWrapper = new HtmlWebWrapper(_log, System.Text.Encoding.GetEncoding("EUC-JP")); var sqlPath = Path.GetFullPath(@"..\..\..\VehicleStatsData\SQLDatabase.mdf"); _sqlExtractRepository = RepositoryFactory.GetRepository("SqlExtractRepository", new object[] { _log, @"Data Source=(LocalDB)\v11.0;AttachDbFilename=" + sqlPath + ";Integrated Security=True" }); //_fileStatsRepository = RepositoryFactory.GetRepository("FileExtractRepository", new object[] { _log, outputPath }); //_argBuilder = new AutoTraderArgumentBuilder(_htmlWebWrapper, _log); _gooNetArgBuilder = new GooNetArgumentBuilder(_japaneseHtmlWebWrapper, _log); _autoTraderScraper = new AutoTraderZaPageScraper(_log); _gooNetPageScraper = new GooNetPageScraper(); }
public AutoTraderExtractionEngine(IHtmlWebWrapper htmlWebWrapper, ILog log, IAutoTraderZaPageScraper pageScraper) { _log = log; _htmlWebWrapper = htmlWebWrapper; _pageScraper = pageScraper; }