title: Unit tests with NSURLSession
body: <p>I'd like to write unit tests for methods that use the shared <code>NSURLSession</code>, and in particular, <code>NSURLSessionDataTask</code> to download data. Basically, I would like the target methods to receive mock responses/data without requiring an internet connection.</p>
  
  <p>What is the less unobtrusive way of mocking these components? I was thinking of populating <code>NSURLCache</code> with mock responses and data but I feel this assumes too much of how <code>NSURLSession</code> and <code>NSURLSessionDataTask</code> work. Any other suggestions?</p>