#660: Add mocking to test

Another attempt at submitting the same changes in another Pull Request.  It should have all of the reviewed changes, but let me know if there is anything else.