There are a number of tools available to support mocking of objects and they are generally in one of two categories - static or dynamic.
Static mock tools generate mock implementations as source code which is
compiled with the test suite, while dynamic mock frameworks create the mock
implementations at runtime.
Rhino Mocks is a dynamic mock object framework for the .NET
platform which allows developers to create mock objects and verify the
interactions while unit testing. Rhino Mocks is a very powerful framework, in
this part I will only discuss how to get started.
Rhino mocks is an open source framework created by
Ayende Rahien and is available to download from the official web site.
There are alternative frameworks available such as EasyMock.Net and NMock.
Rhino mocks works with all the .NET unit testing frameworks
currently available. For this series I will be using MbUnit, which can be
downloaded from www.MbUnit.com, as it has
some excellent features that improve the unit tests.