public void Add_IsUriRecrawlingIsFalse_DuplicateNotAdded() { _unitUnderTest = new FifoScheduler(false);//this is the default _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); Assert.AreEqual(1, _unitUnderTest.Count); }
public void Add_IsUriRecrawlingIsTrue_DuplicateAdded() { _unitUnderTest = new FifoScheduler(true); _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); Assert.AreEqual(3, _unitUnderTest.Count); }
public void Clear_RemovesAllPrevious() { _unitUnderTest = new FifoScheduler(); _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); _unitUnderTest.Add(new PageToCrawl(new Uri("http://b.com/"))); _unitUnderTest.Add(new PageToCrawl(new Uri("http://c.com/"))); _unitUnderTest.Clear(); Assert.AreEqual(0, _unitUnderTest.Count); }
public void Add_IEnumerableParam_IsUriRecrawlingIsTrue_DuplicateAdded() { _unitUnderTest = new FifoScheduler(true);//this is the default _unitUnderTest.Add(new List <PageToCrawl> { new PageToCrawl(new Uri("http://a.com/")), new PageToCrawl(new Uri("http://a.com/")), new PageToCrawl(new Uri("http://a.com/")) }); Assert.AreEqual(3, _unitUnderTest.Count); }
public void Add_ValidPageToCrawl_IsAdded() { _unitUnderTest.Add(new PageToCrawl(new Uri("http://a.com/"))); Assert.AreEqual(1, _unitUnderTest.Count); }