You can mock classes with Moq. You just need to create a new Mock with valid constructor parameters.
In your case:
var userManagerMock = new Mock<UserManager<User>>(Mock.Of<IUserStore<User>>(), null, null, null, null, null, null, null, null);
When creating new mock for class, Moq uses one of the constructors of the class, in the UserManager class, there is a single constructor with 9 parameters:
UserManager<TUser>(IUserStore<TUser>, IOptions<IdentityOptions>, IPasswordHasher<TUser>, IEnumerable<IUserValidator<TUser>>, IEnumerable<IPasswordValidator<TUser>>, ILookupNormalizer, IdentityErrorDescriber, IServiceProvider, ILogger<UserManager<TUser>>)
The only parameter that is mandatory is the first one, all the others you can pass null value.
Now you can setup any virtual method or property.
Full example:
[TestMethod]
public void MockUserManager()
{
// Arrange
var userManagerMock = new Mock<UserManager<User>>(Mock.Of<IUserStore<User>>(), null, null, null, null, null, null, null, null);
userManagerMock.Setup(x => x.CheckPasswordAsync(It.IsAny<User>(), It.IsAny<string>())).ReturnsAsync(true);
// Act
var res = userManagerMock.Object.CheckPasswordAsync(new User(), "123456").Result;
// Assert
Assert.IsTrue(res);
}
public class User
{
}