How to Construct IdentityResult With Success == true

Would the static IdentityResult.Success property work? http://msdn.microsoft.com/en-us/library/microsoft.aspnet.identity.identityresult.success(v=vs.108).aspx

Edit:
To add some more detail, it seems what you want to do is get your mocked CreateAsync to return an IdentityResult where Suceeded is true. For that I would just return IdentityResult.Success from your mock. There’s shouldn’t be a need to mock the IdentityResult itself.

Example: How to setup a service that returns Successful identity result.

    applicationUserManagerMock.Setup(s => 
        s.CreateAsync(It.IsAny<ApplicationUser>(), It.IsAny<string>())
    ).ReturnsAsync(IdentityResult.Success);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)