public void CanReadFeed()
        {
            var rssService = new RssReaderService();

            var rss = rssService.ReadOne("http://feeds.feedburner.com/HanselminutesCompleteMP3?format=xml");

            Assert.IsNotNull(rss);

            Assert.IsTrue(rss.Items.Count > 0);
            Assert.IsTrue(! string.IsNullOrWhiteSpace( rss.Items[0].Mp3));
        }
        // GET: Updater
        public ActionResult Run()
        {
            var db = new DataContext();
            var rssReaderService = new RssReaderService();
            var updater = new FeedsUpdaterService(rssReaderService, db);
            db.DeleteShows();

            db.ActiveProducers()
                .AsQueryable()
                .ToList()
                .ForEach(p =>
                {
                    updater.Update(p);
                });

            return RedirectToAction("index","home");
        }
        public void WillUpdateDB()
        {
            var db = new DataContext();
            var rssReaderService = new RssReaderService();
            var updater = new FeedsUpdaterService(rssReaderService, db);
            db.DeleteShows();

            db.Producers.AsQueryable()
                .ToList()
                .ForEach(p =>
                {
                    updater.Update(p);
                });

            Assert.IsTrue(db.Shows.Count() > 0);

            Console.WriteLine("Shows count: " + db.Shows.Count());

            Assert.IsTrue(db.Shows.Count() > 0);
        }
 public FeedsUpdaterService(RssReaderService rssReader, DataContext db)
 {
     _rssReader = rssReader;
     _db = db;
 }