Posts Tagged: TDD


26
Aug 10

Mocking Rob Conery’s ISession

Recently at work, we’ve really started to embrace TDD (and BDD).  As a team, it helps us write much cleaner, more efficient code.  I’m not going to preach forever about the benefits of TDD.  There are thousands of other blog posts out there beating this topic to death.  One of the ways that we communicate with our databases at work is by using Rob Conery’s ISession interface.  We have an implementation of this interface for Entity Framework 4, and it works beautifully.  However, given that this interface is super generic, it’s less than obvious how you would mock such a thing.  Here’s the ISession interface in all its glory:

Continue reading →