You don't mock classes, you mock interfaces. In your case you could have two mocks - one that mocks IUserRepository and one that mocks IGenericRepository. They shouldn't necessarily be the same object - if they DO have to be the same object, then it may be a design flaw.