public void ValidTest2() { Site site = new Site { Link = "infofemmes-pch.org" }; SiteChecker siteChecker = new SiteChecker(site); siteChecker.Check(); Assert.True(!siteChecker.FitsRequirements); }
public void ValidTest1() { Site site = new Site() { Link = "iwalktheextramile.com" }; SiteChecker siteChecker = new SiteChecker(site); siteChecker.Check(); // if (site.Bl != 1 || site.TrustFlow!=0 || site.CitationFlow!=5) // { // Assert.Fail(); // } Assert.True(siteChecker.FitsRequirements); }
private void StartParsing() { ControlsContainer.ManualUsers = new List <SiteView>(); string[] sites = { }; Application.Current.Dispatcher.Invoke(() => { sites = new TextRange(Text.Document.ContentStart, Text.Document.ContentEnd).Text.Split(Convert.ToChar("\n")); }); sites.Select(x => x.Replace("\r", "")).Where(x => !string.IsNullOrEmpty(x)).Select(x => new Database.Site { Link = x }).ToList().ForEach(x => { Interlocked.Increment(ref _threadCount); var temp = x; new Thread(() => { SiteChecker siteChecker = new SiteChecker(temp); siteChecker.Check(); if (siteChecker.FitsRequirements) { ControlsContainer.ManualUsers.Add(new SiteView(temp)); } Interlocked.Decrement(ref _threadCount); }) { IsBackground = true }.Start(); }); while (Interlocked.Read(ref _threadCount) > 0) { Thread.Sleep(1000); } Application.Current.Dispatcher.Invoke(() => { Text.Document.Blocks.Clear();; ProcessData.IsEnabled = true; ManualResult manualResult = new ManualResult(); manualResult.Show(); }); }