public void NegativeThrowsABadURL() { //arrange var dictionary = new List <Tuple <string, string> >(); dictionary.Add(new Tuple <string, string>("Company A", "https://notrealrssfeedimreallysureitsnotrealtrustme.com")); //act + assert Assert.ThrowsException <HttpRequestException>(() => { RssRetriever.GetQuietFeeds(dictionary, 0); }); }
public void NegativeThrowsABadFeed() { //arrange var dictionary = new List <Tuple <string, string> >(); dictionary.Add(new Tuple <string, string>("Company A", "https://google.com")); //act + assert Assert.ThrowsException <System.Xml.XmlException>(() => { RssRetriever.GetQuietFeeds(dictionary, 0); }); }
public void PositiveCanOpenKnownGoodRssFeed() { //arrange var dictionary = new List <Tuple <string, string> >(); dictionary.Add(new Tuple <string, string>("Company A", TestRssFeedHelper.MakeNewTestRssFeedWithDate(DateTime.UtcNow))); //act var ret = RssRetriever.GetQuietFeeds(dictionary, 0); //assert Assert.IsTrue(ret.Count == 1); }
public void PositiveReturnFeedWithOutUpdatesForSpecifiedDateOnTheDot() { //arrange var givenNumberOfDaysOfSilence = 5; var latestPost = 5; var dictionary = new List <Tuple <string, string> >(); dictionary.Add(new Tuple <string, string>("Company A", TestRssFeedHelper.MakeNewTestRssFeedWithDate(DateTime.UtcNow.AddDays(-1 * latestPost)))); //act var ret = RssRetriever.GetQuietFeeds(dictionary, givenNumberOfDaysOfSilence); //assert Assert.IsTrue(ret.Count == 1); }
public HashSet <RssSummary> Get(double days = 5) { return(RssRetriever.GetQuietFeeds(DbContext._db.Select(x => x.ToTuple).ToList(), days)); }