Top Banner
Mocks and Stubs Test Doubles with and without Rhino Mocks
10

Mocks and Stubs

Feb 23, 2016

Download

Documents

Carlo

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
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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.