private void SetupMockSignInManagerSuccess(string password, IdentityUser user) { MockSignInManager.Setup(x => x.CheckPasswordSignInAsync( user, password, It.IsAny <bool>())) .Returns(Task.Run(() => SignInResult.Success)); MockSignInManager.Setup(x => x.CreateUserPrincipalAsync(user)) .Returns <IdentityUser>(x => Task.Run(() => (ClaimsPrincipal) new MockClaimsPrincipal(x))); }
private void SetupMockSignInManagerFail() { MockSignInManager.Setup(x => x.CheckPasswordSignInAsync(It.IsAny <IdentityUser>(), It.IsAny <string>(), It.IsAny <bool>())) .Returns(Task.Run(() => SignInResult.Failed)); }