How to mock the following class:
UserRepository : GenericRepository, IUserRepository
public class GenericRepository : IGenericRe
If I understand the question correctly, you want have a single mock instance of UserRepository, and for the purposes of a test, setup calls to methods from both the IGenericRepository interface and the IUserRepository interface.
You can implement multiple interfaces with a single mock instance like this:
var genericRepositoryMock = new Mock>();
genericRepositoryMock.Setup(m => m.CallGenericRepositoryMethod()).Returns(false);
var userRepositoryMock = genericRepositoryMock.As();
userRepositoryMock.Setup(m => m.CallUserRepositoryMethod()).Returns(true);
However, as D Stanley pointed out, the need to do this is probably an indication that there is a flaw in your design.