예제 #1
0
        public void ConfirmGoodPasswordWhenHavingSpecialCharacter()
        {
            var password = "******";

            Assert.IsFalse(RandomPasswordProvider.IsGoodPassword(password, new PasswordRequestOptions()
            {
                CaseType = new CaseTypeLettersAndNumbers(), SpecialCharacter = true
            }));
        }
예제 #2
0
        public void ConfirmBadPasswordWhenMissingNumbers()
        {
            var password = "******";

            Assert.IsFalse(RandomPasswordProvider.IsGoodPassword(password, new PasswordRequestOptions()
            {
                CaseType = new CaseTypeLettersAndNumbers(), SpecialCharacter = false
            }));
        }
예제 #3
0
        public void AddLowerCaseToAnAllUpperCasePasswordAndReplaceTheCorrectLetter()
        {
            var originalPassword = "******";

            var provider = new RandomPasswordProvider(randomStringSource);

            var newPassword = provider.GenerateMixedCase(originalPassword);

            Assert.AreEqual(originalPassword, newPassword.ToUpper());
        }
예제 #4
0
        public void ConfirmGoodPasswordHasLettersAndNumbers()
        {
            var password = "******";

            Assert.IsTrue(RandomPasswordProvider.IsGoodPassword(password,
                                                                new PasswordRequestOptions()
            {
                CaseType = new CaseTypeLettersAndNumbers(), SpecialCharacter = false
            }));
        }
예제 #5
0
        public void AddLowerCaseToAnAllUpperCasePassword()
        {
            var originalPassword = "******";

            var provider = new RandomPasswordProvider(randomStringSource);

            var newPassword = provider.GenerateMixedCase(originalPassword);

            Assert.IsTrue(newPassword.Any(char.IsUpper) && newPassword.Any(char.IsLower));
        }