The examples I\'ve seen for using moq for a repository only show how to mock things being returned. I have a somewhat strange requirement: when a query is executed, if a conditi
This blog article might be of use, although my design has changed somewhat since I wrote the post and I really need to update it. I used teh generic repository pattern in a way that enables the DbContext to be mocked. This allows the data access layer to be tested 'right up to the edges'.