public void Initialize() { ioDevice = Substitute.For <IIoDevice>(); var mockHandler = new MockHttpMessageHandler(); var httpClient = new HttpClient(mockHandler); pageDownloadService = new PageDownloadService(ioDevice, httpClient); pageDownloadService.BaseAdress = "https://en.wikipedia.org"; }
public WikiReferencesCollector( IPageDownloadService pageDownloadService, IFileSystemService fileSystemService, IWikiReferencesParsingService wikiReferencesParser, IReferencesDbService referencesDbService, IIoDevice ioDevice) { this.folderPath = ConfigurationManager.AppSettings["FolderPath"]; this.maxIterations = int.Parse(ConfigurationManager.AppSettings["MaxIterations"]); this.startPage = ConfigurationManager.AppSettings["StartPage"]; this.pageDownloadService = pageDownloadService; this.pageDownloadService.BaseAdress = ConfigurationManager.AppSettings["Uri"]; this.fileSystemService = fileSystemService; this.wikiReferencesParsingService = wikiReferencesParser; this.referencesDbService = referencesDbService; this.ioDevice = ioDevice; this.mutexObj = new Mutex(true, "ReferenceCollector", out canRun); dbLock = new object(); }
public EuroNewsSite(EuroNewsSiteParser newsSiteParser, IPageDownloadService pageDownloadService, IExtendedRandom extendedRandom) : base(newsSiteParser, pageDownloadService, extendedRandom) { }
protected NewsSite(NewsSiteParser newsSiteParser, IPageDownloadService pageDownloadService, IExtendedRandom extendedRandom) { _extendedRandom = extendedRandom ?? throw new ArgumentNullException(nameof(extendedRandom)); _pageDownloadService = pageDownloadService ?? throw new ArgumentNullException(nameof(pageDownloadService)); _newsSiteParser = newsSiteParser ?? throw new ArgumentNullException(nameof(newsSiteParser)); }
public NewsArticleProviderFactory(IPageDownloadService pageDownloadService, IExtendedRandom extendedRandom) { _pageDownloadService = pageDownloadService; _extendedRandom = extendedRandom; }