Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What book on TDD for C# with treatment of Mocks

Tags:

c#

.net

tdd

mocking

Can you recoment a book on on Unit Testing and TDD for C# with at least some treatment of Mock Objects?

I have seen this question but it does not seem to mention mocking.

like image 789
Dan Avatar asked Dec 06 '22 06:12

Dan


2 Answers

Have a look at Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce - a work in progress, but free online. The code examples are in java, which shouldn't be a problem if you're a C# developer, and does focus extensively on Mocks.

like image 77
Bayard Randel Avatar answered Dec 09 '22 14:12

Bayard Randel


The Art of Unit Testing: With Examples in .NET by Roy Osherove (Amazon Page, Official Site) sounds like what you're looking for. He devotes one chapter introducing the concepts of stub and mock objects (using a "roll-your-own" approach), and then a second chapter on using mock object frameworks, particularly Rhino Mocks. There is somewhat less emphasis on Test-Driven Development, but there is quite a lot of information about TDD available from other sources, and TDD isn't all that language-specific.

like image 26
Eric Pohl Avatar answered Dec 09 '22 14:12

Eric Pohl