I have a method that gets an RSS feed using LINQ to XML and returns a collection of an object that grabs only the data I need. There's really only one other method in the class I'm concerned about that you'll see in the sample -- RemoveUrlNoise.
How do I test a method like this or change it to be more testable?
public IEnumerable<PostDetails> GetPostDetails(string rssUrl) { XElement feed = XElement.Load(rssUrl); var items = from item in feed.Elements("channel").Elements("item") select item; return items.Select(item => new PostDetails { Title = item.Element("title").Value, Url = RemoveUrlNoise(item.Element("guid").Value), PubDate = item.Element("pubDate").Value }).OrderBy(i => i.PubDateAsDateTime).ToList(); }