October 2013
Intermediate to advanced
368 pages
9h 20m
English
You can avoid being blocked, in any of these cases, by employing a test double . A test double is a stand-in—a doppelgänger (literally: “double walker”)—for a production class. HTTP giving you trouble? Create a test double HTTP implementation! The job of the test double will be to support the needs of the test. When a client sends a GET request to the HTTP object, the test double can return a canned response. The test itself determines the response that the test double should return.
Imagine you are on the hook to build the service but you aren’t concerned with unit testing it (perhaps you plan on writing an integration test). You have access to some classes that you can readily reuse.
CurlHttp, which uses cURL[15] to make ...