You are previewing Test-Driven iOS Development.

Test-Driven iOS Development

Cover of Test-Driven iOS Development by Graham Lee Published by Addison-Wesley Professional

8. Networking Code

The code in BrowseOverflow can parse data received from the Stack Overflow website and use it to build model objects that will be used in the app. The problem of fetching the data from the website in the first place still remains. In this chapter you’ll see how to build that code, and how to deal with the problem of talking to the outside world in a test-driven fashion.

On the face of it, the problem we have to deal with next in BrowseOverflow seems intractable: looking back to Chapter 3, “How to Write a Unit Test,” you’ll remember that unit tests are supposed to be fast, repeatable, and reliable. How do you achieve those properties when dealing with network code? So many issues can affect the performance and reliability of ...

The best content for your career. Discover unlimited learning on demand for around $1/day.