100 likes | 207 Views
Mocks and Stubs. Test Doubles with and without Rhino Mocks. Why do I care. About all this mocking baloney?. The “Unit” in Unit Test. No External Dependencies No Database No Network No Registry No context-dependent information ( config files, etc.) Goal: 100-500/sec
E N D
Mocks and Stubs Test Doubles with and without Rhino Mocks
Why do I care • About all this mocking baloney?
The “Unit” in Unit Test • No External Dependencies • No Database • No Network • No Registry • No context-dependent information (config files, etc.) • Goal: 100-500/sec • BUT…what about internal dependencies?
Real-World Testing Strategies • Inside-Out
Real-World Testing Strategies • Outside-In
A Closer Look – Indirect Inputs • Leave no code behind! • Can we control it? • If not, STUB TIME!!!
A Closer Look – Indirect Outputs • Do I care if you’re called? • Leave no requirement behind! • Favor doubles over the real deal
Links et. al. • Rhino Mocks - http://www.ayende.com/projects/rhino-mocks.aspx • Moq - http://code.google.com/p/moq/ • xUnit Test Patterns - http://xunitpatterns.com/ • Me • http://jimmybogard.lostechies.com • http://feeds.feedburner.com/GrabBagOfT • http://www.lostechies.com • http://feeds.feedburner.com/LosTechies • http://twitter.com/jbogard