static void Main(string[] args)
        {
            CalculationFactory factory = new CalculationFactory();
            decimal            a       = 10;
            decimal            b       = 2;

            decimal result = factory.Divide(a, b);

            Console.WriteLine("Result of dividing " + a.ToString() + " by " + b.ToString() + " is " + result.ToString());
            Console.WriteLine();

            Console.WriteLine("***************************************************************");

            Console.WriteLine();

            //Invalid password
            string password = "******";

            //Valid Password
            //string password = "******";

            Console.WriteLine("Password selected: " + password);
            Console.WriteLine();
            //var validationtext = ValidatePassword.PassWordValid(password);
            var validationtext = RefactoredValidatePassword.PassWordValid(password);

            if (!string.IsNullOrEmpty(validationtext))
            {
                Console.WriteLine("Selected password is a NOT a VALID password ");
                Console.WriteLine();
                Console.WriteLine("**********************************************************************************");
                Console.WriteLine(validationtext);
                Console.WriteLine("**********************************************************************************");
            }
            else
            {
                Console.WriteLine("Selected password is a valid password");
            }

            Console.ReadLine();
        }
예제 #2
0
 public void CheckForSpecialCharectersTest()
 {
     Assert.IsTrue(RefactoredValidatePassword.CheckForSpecialCharecters(password));
 }
예제 #3
0
 public void CheckForRecentPasswordsTest()
 {
     Assert.IsTrue(RefactoredValidatePassword.CheckForRecentPasswords(password));
 }
예제 #4
0
 public void CheckForUserNameMatchTest()
 {
     Assert.IsTrue(RefactoredValidatePassword.CheckForUserNameMatch(password));
 }
예제 #5
0
 public void CheckPasswordLengthTest()
 {
     Assert.IsTrue(RefactoredValidatePassword.CheckPasswordLength(password));
 }
예제 #6
0
 public void CheckUpperCaseAndNumericTest()
 {
     Assert.IsTrue(RefactoredValidatePassword.CheckUpperCaseAndNumeric(password));
 }