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";
        }
Пример #2
0
 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();
 }
Пример #3
0
 public EuroNewsSite(EuroNewsSiteParser newsSiteParser, IPageDownloadService pageDownloadService, IExtendedRandom extendedRandom)
     : base(newsSiteParser, pageDownloadService, extendedRandom)
 {
 }
Пример #4
0
 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));
 }
Пример #5
0
 public NewsArticleProviderFactory(IPageDownloadService pageDownloadService, IExtendedRandom extendedRandom)
 {
     _pageDownloadService = pageDownloadService;
     _extendedRandom      = extendedRandom;
 }