June 2017
Beginner to intermediate
274 pages
6h 49m
English
A mock object is a clever piece of code; it could pretend to be almost any kind of object or function, but instead of doing whatever the original did, it just records what is done with it so we can check it later. Let's play with a mock object for a moment to get a feel for them:

Refer to the preceding screenshot. We can access pretty much any attribute of the mock object without defining it ahead of time. The result is another mock object. Similarly, we can call almost any method we want without defining it ahead of time and the result is yet another mock object, as shown here:
This by itself is enough to let a mock ...
Read now
Unlock full access