public ActionResult Index(FeedViewModel viewModel) { var feed = new AtomFeed(viewModel.Url) { Reader = this.Reader }; feed.PopulateEntries(); var entriesViewModel = new PopulateFeedViewModel(); entriesViewModel.Entries.AddRange(feed.Entries.Select(entry => new FeedEntryViewModel { Title = entry.Title }).ToList()); return this.View(entriesViewModel); }
public void AddAtomFeedShouldWork() { Assert.AreEqual(0, this.context.Feeds.Count()); var feed = new AtomFeed("http://fake.com") { Owner = "Me" }; this.context.Feeds.Add(feed); this.context.SaveChanges(); Assert.AreEqual(1, this.context.Feeds.Count()); }