Esempio n. 1
0
        private static void Main(string[] args)
        {
            var verifier = new PasswordVerifier(
                PasswordVerifier.ValidateEmpty,
                PasswordVerifier.ValidateMinLength,
                PasswordVerifier.ValidateMaxLength,
                PasswordVerifier.ValidateLetter,
                PasswordVerifier.ValidateDigit);

            var service = new PasswordCheckerService(new SqlRepository(), verifier);

            System.Console.WriteLine(service.VerifyPassword("123aff3fe"));

            verifier.AddCheck(Program.ValidateCapital);
            System.Console.WriteLine(service.VerifyPassword("123aff3fe"));

            verifier.RemoveCheck(PasswordVerifier.ValidateMinLength);
            System.Console.WriteLine(service.VerifyPassword("2aD"));

            System.Console.Read();
        }