Mocks are different from stubs – rather than just testing the return value of a function, we focus on testing expectations from the collaborator functions' perspective. What kind of activities does a collaborator function expect? Here are some examples for our use case:
- From the check_background function's perspective, was it called only once for each open_account call?
- From the create_account function's perspective, was it called when a background check was successful?
- From the create_account function's perspective, was it not called when the background check failed?
- From the notify_account function's perspective, was it called with an account number that is greater than 0?
The process to set ...