コード例 #1
0
        public async Task TestMixedAsync()
        {
            var errorCode = StanfordPasswordValidatorBase.ErrorCode.NoMixedCase;
            var password  = "******";

            IdentityResultAssert.IsFailure(await validator.ValidateAsync(manager, user, password),
                                           errorCode);
            password = new string('a', 16);
            IdentityResultAssert.IsFailure(await validator.ValidateAsync(manager, user, password), errorCode);

            password = "******";
            IdentityResultAssert.IsFailure(await validator.ValidateAsync(manager, user, password), errorCode);

            password = new string('a', 20);
            IdentityResultAssert.IsSuccess(await validator.ValidateAsync(manager, user, password));
        }
コード例 #2
0
 public async Task TestCorrectAsync(string password)
 {
     IdentityResultAssert.IsSuccess(await validator.ValidateAsync(manager, user, password));
 }