Mock a database repository using Moq ref: http://www.codeproject.com/Articles/47603/Mock-a-database-repository-using-Moq