So, carrying on with my new years resolution to get more in to TDD, I am now starting to work more with Rhino Mocks.
One thing I am keen to do is to make sure I reall
A "stub" is an implementation of an interface that exists to provide data/a response of some sort. For example:
Normally this would be provided by another service (be it Web Service, another application, a database) but in order to improve the testability of the code, the results are "faked".
A major benefit of this is that it allows assertions to be made in unit tests based on the data expected. If errors arise due to data errors, then tests can easily be added, a new stub created (replicating the data error) and code produced to correct the error.
Stubs differ to Mocks in that they are used to represent and test the state of an object, whereas a Mock tests its interaction.