public void passwordCheckTest() { PasswordChecker pc = new PasswordChecker("Moose"); bool wynik = pc.isPasswordCorrect("Moose"); Assert.IsFalse(wynik); wynik = pc.isPasswordCorrect("Master"); Assert.IsFalse(wynik); wynik = pc.isPasswordCorrect("MooseMaster"); Assert.IsTrue(wynik); wynik = pc.isPasswordCorrect("Moose123Master456__!asd"); Assert.IsTrue(wynik); }
public void strenghtCheckTest() { PasswordChecker pc = new PasswordChecker("Moose"); Strenght str = pc.getPasswordStrenght("Master"); Assert.AreEqual(Strenght.None, str); str = pc.getPasswordStrenght("1234567"); Assert.AreEqual(Strenght.None, str); str = pc.getPasswordStrenght("MooseMaster"); Assert.AreEqual(Strenght.Weak, str); str = pc.getPasswordStrenght("Moose9Master"); Assert.AreEqual(Strenght.Medium, str); str = pc.getPasswordStrenght("Moose!!9Master"); Assert.AreEqual(Strenght.Strong, str); }
public void initializationTest() { PasswordChecker pc = new PasswordChecker("abla"); Assert.IsNotNull(pc); Assert.AreEqual(pc.Login, "abla"); }