mocks and stubs

10
Mocks and Stubs Test Doubles with and without Rhino Mocks

Upload: carlo

Post on 23-Feb-2016

69 views

Category:

Documents


0 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Mocks and Stubs

Mocks and StubsTest Doubles with and without Rhino Mocks

Page 2: Mocks and Stubs

About all this mocking baloney?

Why do I care

Page 3: Mocks and Stubs

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?

The “Unit” in Unit Test

Page 4: Mocks and Stubs

Code time!

Page 5: Mocks and Stubs

Inside-Out

Real-World Testing Strategies

Page 6: Mocks and Stubs

Outside-In

Real-World Testing Strategies

Page 7: Mocks and Stubs

Note on tools

Page 8: Mocks and Stubs

Leave no code behind! Can we control it? If not, STUB TIME!!!

A Closer Look – Indirect Inputs

Page 9: Mocks and Stubs

Do I care if you’re called? Leave no requirement behind! Favor doubles over the real deal

A Closer Look – Indirect Outputs

Page 10: Mocks and Stubs

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

Links et. al.