public void TestRemoveFromUrl() { MacroscopeAllowedHosts AllowedHosts = new MacroscopeAllowedHosts(); List <string> TestUrls = new List <string> (); TestUrls.Add("https://nazuke.github.io/SEOMacroscope/"); TestUrls.Add("https://bogus.bogus.com/some/path/index.html"); TestUrls.Add("https://www.google.com/"); foreach (string Url in TestUrls) { AllowedHosts.AddFromUrl(Url: Url); } Assert.AreEqual( TestUrls.Count, AllowedHosts.Count(), string.Format("FAIL: {0} :: {1}", TestUrls.Count, AllowedHosts.Count()) ); this.DebugMsg(TestUrls[1]); this.DebugMsg(AllowedHosts.Count().ToString()); AllowedHosts.RemoveFromUrl(Url: TestUrls[1]); this.DebugMsg(AllowedHosts.Count().ToString()); Assert.AreEqual( TestUrls.Count - 1, AllowedHosts.Count(), string.Format("FAIL: {0} :: {1}", TestUrls.Count - 1, AllowedHosts.Count()) ); }