Posted by Sébastien Lachance with Comments (0)
Listening to the last screencast of Rob Conery (MVC Storefront) made me realize something that I haven't really understood before.
Suppose you have the interface of a repository, let's say IEntryRepository. Then you have the actual SqlEntryRepository and TestEntryRepository. When I am doing TDD, I am testing the TestEntryRepository. But it will not be used in production. Why bothering with testing it then?
Because TDD is a design process. Even if I am testing my code, I am also designing it. The SqlEntryRepository will benefits from the actual design of the repository we use for testing.
Related posts