Ejemplo n.º 1
0
        public void ConfirmGoodPasswordWhenHavingSpecialCharacter()
        {
            var password = "******";

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

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

            var provider = new RandomPasswordProvider(randomStringSource);

            var newPassword = provider.GenerateMixedCase(originalPassword);

            Assert.AreEqual(originalPassword, newPassword.ToUpper());
        }
Ejemplo n.º 4
0
        public void ConfirmGoodPasswordHasLettersAndNumbers()
        {
            var password = "******";

            Assert.IsTrue(RandomPasswordProvider.IsGoodPassword(password,
                                                                new PasswordRequestOptions()
            {
                CaseType = new CaseTypeLettersAndNumbers(), SpecialCharacter = false
            }));
        }
Ejemplo n.º 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));
        }