Can not instantiate proxy…Could not find a parameterless constructor

MOQ is good for mocking interfaces, but does not work so well with concrete classes. So instead of mocking concrete class, ask for the inteface:

var userStore = new Mock<IUserStore<PreRegistrationMVC.Models.ApplicationUser>>();

Also ApplicationUser should be POCO, so no need to mock it, just create its instance without MOQ and use in tests.

Leave a Comment