Re: Mocking collaborators that are third-party libraries
George Dinwiddie <[email protected]>
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Organization | iDIA Computing, LLC |
| Message-ID | <[email protected]> |
Eb,
On 7/11/13 2:28 PM, Eb wrote:
> Hi everyone -
>
> What criteria do you use to determine if a collaborator that is a
> third-party should be mocked and the test should verify that the
> collaborator was indeed called when it was supposed to be?
I wouldn't do that. I use adapters for third-party collaborators and
mock my adapters to verify behavior. I also write integration tests for
the adapter's interaction with the third-party.
Steve Freeman's advice is to never mock something you don't own. I've
only violated that advice when I needed to simulate error conditions
while testing my adapter.
- George
--
Want to speak at AgileDC October 8, 2013? http://agiledc.org/speak/
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/testdrivendevelopment/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/testdrivendevelopment/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/