コード例 #1
0
 public void RandomPwdGeneratorTest5()
 {
     try
     {
         RandomPwdGenerator ngpwd = new RandomPwdGenerator();
         AnalyzePassword    napw  = new AnalyzePassword(ngpwd.getRandomPwd());
     }
     catch (ErrorLogPassContent e)
     {
         Assert.Fail("Generated PWD in not acceptable");
     }
     catch (Exception)
     {
         Assert.Fail("Unspecified error happened");
     }
 }
コード例 #2
0
 public void AnalyPwdTest1_correct1()
 {
     try {
         AnalyzePassword ap = new AnalyzePassword("passWord1_");
     }
     catch (ErrorLogPassContent e)
     {
         if (e.getMessage() != "")
         {
             Assert.Fail("Wrong error is given");
         }
     }
     catch (Exception e)
     {
         Assert.Fail("Unexpected error is given");
     }
 }
コード例 #3
0
 /// <summary>
 /// analyze the written password difficulty
 /// </summary>
 /// <returns>true = good / false = problematic</returns>
 public bool needRewisePasswordByUser()
 {
     try
     {
         controlAnalizePwdContent = new AnalyzePassword(txtbPwdNew.Text);
         return(false);
     }
     catch (ErrorLogPassContent)
     {
         return(true);
     }
     catch (Exception e)
     {
         handleError("Ismertlen hiba történt (ContrPersPwdAnaly) " + e.Message);
         return(true);
     }
 }
コード例 #4
0
 public void AnalyPwdTest5_noPassword()
 {
     try
     {
         AnalyzePassword ap = new AnalyzePassword("");
         Assert.Fail("Failure is not recognised");
     }
     catch (ErrorLogPassContent e)
     {
         if (e.getMessage() != "Nem adott meg jelszót, kérem írja be!")
         {
             Assert.Fail("Wrong error is given");
         }
     }
     catch (Exception e)
     {
         Assert.Fail("Unexpected error is given");
     }
 }
コード例 #5
0
 public void AnalyPwdTest4_shortButGood2()
 {
     try
     {
         AnalyzePassword ap = new AnalyzePassword("w0Rd&");
         Assert.Fail("Failure is not recognised");
     }
     catch (ErrorLogPassContent e)
     {
         if (e.getMessage() != "A jelszó túl rövid, hogy megfelelő legyen")
         {
             Assert.Fail("Wrong error is given");
         }
     }
     catch (Exception e)
     {
         Assert.Fail("Unexpected error is given");
     }
 }
コード例 #6
0
 public void AnalyPwdTest12_noSpec2()
 {
     try
     {
         AnalyzePassword ap = new AnalyzePassword("pAssword9");
         Assert.Fail("Wrong error is given");
     }
     catch (ErrorLogPassContent e)
     {
         if (e.getMessage() != "A jelszóban nincs speciális karakter")
         {
             Assert.Fail("Wrong error is given");
         }
     }
     catch (Exception e)
     {
         Assert.Fail("Unexpected error is given");
     }
 }
コード例 #7
0
 public void AnalyPwdTest11_noLowercase2()
 {
     try
     {
         AnalyzePassword ap = new AnalyzePassword("PAS5/WORD");
         Assert.Fail("Wrong error is given");
     }
     catch (ErrorLogPassContent e)
     {
         if (e.getMessage() != "A jelszóban nincs kisbetűs karatker")
         {
             Assert.Fail("Wrong error is given");
         }
     }
     catch (Exception e)
     {
         Assert.Fail("Unexpected error is given");
     }
 }
コード例 #8
0
 public void AnalyPwdTest9_noUppercase2()
 {
     try
     {
         AnalyzePassword ap = new AnalyzePassword("pas5_word");
         Assert.Fail("Wrong error is given");
     }
     catch (ErrorLogPassContent e)
     {
         if (e.getMessage() != "A jelszóban nincs nagybetűs karakter")
         {
             Assert.Fail("Wrong error is given");
         }
     }
     catch (Exception e)
     {
         Assert.Fail("Unexpected error is given");
     }
 }
コード例 #9
0
 public void AnalyPwdTest7_noDigit2()
 {
     try
     {
         AnalyzePassword ap = new AnalyzePassword("*passWord");
         Assert.Fail("Wrong error is given");
     }
     catch (ErrorLogPassContent e)
     {
         if (e.getMessage() != "A jelszóban nincs számkarakter")
         {
             Assert.Fail("Wrong error is given");
         }
     }
     catch (Exception e)
     {
         Assert.Fail("Unexpected error is given");
     }
 }
コード例 #10
0
 public void reviseTheAutenticityOfUserNPwd(string givenName, string givenPwd)
 {
     analyzeUsName  = new AnalyzeUsername(givenName);
     analyzeUsPassw = new AnalyzePassword(givenPwd);
 }