Beispiel #1
0
        void toolStripButtonNewOne_Click(object sender, EventArgs e)
        {
            ConditionCreator conditionCreator = new ConditionCreator();

            conditionCreator.ConditionCreated += new ConditionCreatedHandle(conditionCreator_ConditionCreated);
            conditionCreator.ShowDialog();
        }
Beispiel #2
0
        static void Main()
        {
            PasswordCheckerService passwordCheckerService = new PasswordCheckerService(new SqlRepository());
            ConditionCreator       conditionCreator       = new ConditionCreator();

            conditionCreator.AddConditions(str => str == string.Empty, "Password is empty");
            conditionCreator.AddConditions(str => str.Length <= 7, "Password length too short");
            conditionCreator.AddConditions(str => str.Length >= 15, "Password length too long");
            conditionCreator.AddConditions(str => !str.Any(char.IsLetter), "Password hasn't alphanumerical chars");
            conditionCreator.AddConditions(str => !str.Any(char.IsNumber), "Password hasn't digits");
            try
            {
                ShowInfo(passwordCheckerService.VerifyPassword(conditionCreator.GetConditions(), "12345678a"));
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }
        }
Beispiel #3
0
 public Decision(ConditionCreator creator)
 {
     this.creator = creator;
 }
 internal SubConditionCreator(ConditionCreator c)
 {
     _creator = c;
 }