public void StrengthByRepeatingChars_StringWithRepeating_StrengthReturned()
 {
     Assert.AreEqual(-3, PasswordStrengthLib.StrengthByRepeatingChars("aa12a"));
     Assert.AreEqual(-7, PasswordStrengthLib.StrengthByRepeatingChars("aa1111a"));
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByRepeatingChars("123a"));
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByRepeatingChars("aA"));
 }
 public void CalculateByReapetedSymbols()
 {
     Assert.AreEqual(-3, PasswordStrengthLib.CalculateByReapetedSymbols("aa12a"));
     Assert.AreEqual(-7, PasswordStrengthLib.CalculateByReapetedSymbols("aa1111a"));
     Assert.AreEqual(0, PasswordStrengthLib.CalculateByReapetedSymbols("123a"));
     Assert.AreEqual(0, PasswordStrengthLib.CalculateByReapetedSymbols("aA"));
 }
 public void PasswordStrength_Paasword_StrengthReturned()
 {
     Assert.AreEqual(7, PasswordStrengthLib.PasswordStrength("1"));
     Assert.AreEqual(28, PasswordStrengthLib.PasswordStrength("aa1A"));
     Assert.AreEqual(6, PasswordStrengthLib.PasswordStrength("aaa"));
     Assert.AreEqual(72, PasswordStrengthLib.PasswordStrength("Qwerty123"));
 }
 public void CalculateByLowerCase()
 {
     Assert.AreEqual(0, PasswordStrengthLib.CalculateByLowerCase("a"));
     Assert.AreEqual(0, PasswordStrengthLib.CalculateByLowerCase("AAA"));
 }
 public void CalculateByUpperCase()
 {
     Assert.AreEqual(0, PasswordStrengthLib.CalculateByUpperCase("X"));
     Assert.AreEqual(6, PasswordStrengthLib.CalculateByUpperCase("Xxxx"));
 }
 public void CalculateByNumbers()
 {
     Assert.AreEqual(8, PasswordStrengthLib.CalculateByNumbers("Ag1B2"));
     Assert.AreEqual(0, PasswordStrengthLib.CalculateByNumbers("qwe"));
 }
 public void StrengthByLength()
 {
     Assert.AreEqual(16, PasswordStrengthLib.StrengthByLength("Ag1B"));
 }
 public void IsCorrectPassword_InvalidPassword_FalseReturned()
 {
     Assert.AreEqual(false, PasswordStrengthLib.IsCorrectPassword("Ab.1"));
 }
 public void StrengthByOnlyLetters_StringWithNotOnlyLetters_StrengthReturned() //strength = 0
 {
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByOnlyLetters("132ab"));
 }
 public void StrengthByNumberOfLowerLetters_StringWithoutLowerLetters_StrengthReturned() //strength = ((len-n)*2)
 {
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByNumberOfLowerLetters("A"));
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByNumberOfLowerLetters("AAA"));
 }
 public void StrengthByOnlyLetters_StringWithOnlyLetters_StrengthReturned() //strength = -len
 {
     Assert.AreEqual(-1, PasswordStrengthLib.StrengthByOnlyLetters("a"));
     Assert.AreEqual(-4, PasswordStrengthLib.StrengthByOnlyLetters("Aaaa"));
 }
 public void StrengthByNumberOfUpperLetters_StringWithUpperLetters_StrengthReturned() //strength = ((len-n)*2)
 {
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByNumberOfUpperLetters("A"));
     Assert.AreEqual(2, PasswordStrengthLib.StrengthByNumberOfUpperLetters("Aa"));
     Assert.AreEqual(6, PasswordStrengthLib.StrengthByNumberOfUpperLetters("Aaaa"));
 }
 public void StrengthByNumberOfDigits_String_4xNumberOfDigitsReturned()
 {
     Assert.AreEqual(8, PasswordStrengthLib.StrengthByNumberOfDigits("Ag1B2"));
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByNumberOfDigits("qwe"));
 }
 public void StrengthByLength_String_4xLengthReturned()
 {
     Assert.AreEqual(16, PasswordStrengthLib.StrengthByLength("Ag1B"));
 }
 public void CalculateByNumbers()
 {
     Assert.AreEqual(0, PasswordStrengthLib.CalculateByNumbers("132ab"));
 }
 public void StrengthByOnlyDigits_StringWithOnlyDigits_StrengthReturned() //strength = -len
 {
     Assert.AreEqual(-1, PasswordStrengthLib.StrengthByOnlyDigits("1"));
     Assert.AreEqual(-4, PasswordStrengthLib.StrengthByOnlyDigits("1123"));
 }
 public void CalculateByNumbers()
 {
     Assert.AreEqual(-1, PasswordStrengthLib.CalculateByNumbers("1"));
     Assert.AreEqual(-4, PasswordStrengthLib.CalculateByNumbers("1123"));
 }
 public void StrengthByOnlyDigits_StringWithNotOnlyDigits_StrengthReturned() //strength = 0
 {
     Assert.AreEqual(0, PasswordStrengthLib.StrengthByOnlyDigits("aa12a"));
 }
 public void PasswordStrength()
 {
     Assert.AreEqual(7, PasswordStrengthLib.PasswordStrengthProgramm("1"));
     Assert.AreEqual(72, PasswordStrengthLib.PasswordStrengthProgramm("Qwerty123"));
 }
 public void IsCorrectPassword_CorrectPassword_TrueReturned()
 {
     Assert.AreEqual(true, PasswordStrengthLib.IsCorrectPassword("Ab1"));
 }