Dependencies management is a difficult part of test-driven development (TDD). Mocks and stubs are created to isolate the behavior we would like to test. The article “The Art of Mocking” is a good introduction on this topic. Creating all these testing classes by hand can lead to troubles, but several open source tools to apply mocking principles in .NET. Tools like Rhino Mocks and Moq allow us to create mocks and stubs within our test method. The Mocking Frameworks in .NET video presents techniques that can automate your unit testing process.
This article covers the subject of software testing mocks (also known as test doubles, stubs and fakes, amongst other names). It compares also the creation manual mocks with the usage of a full-fledged mocking framework with examples in .NET.