I\'ve got some code which downloads some RSS feeds.
I\'ve been using WebClient
or Argotic.Syndication.RssFeed
libraries.
Bu
Does anyone have any suggestions to what I can do?
Abstract the actual HTTP call behind an interface. Then write an implmentation of this interface using WebClient. Now have your main class take this interface as dependency. You could now mock this interface in the unit test and configure your dependency injection framework inject the correct implementation at runtime.
I go for creating a wrapper for every external dependency (if it's practical). So, every interaction with the filesystem/a webservice/database should be done through an interface only, which will lead to more testable code.
Another solution of course is (as always) Typemock Isolator.