public Tuple <bool, string> VerifyPasswordCustomTest(string password) { var repository = new SqlRepository(); var verifyPassword = new PasswordCheckerService(repository); verifyPassword.AddChecker(pswd => { if (pswd == "qwerty1234") { return(Tuple.Create(false, $"{password} is very easy. For amebs")); } ; return(Tuple.Create(true, "Password is Ok. User was created")); }); return(verifyPassword.VerifyPassword(password)); }
public static void Main(string[] args) { var repository = new SqlRepository(); var password = "******"; var verifyPassword = new PasswordCheckerService(repository); verifyPassword.VerifyPassword(password); verifyPassword.AddChecker(pswd => { if (pswd == "qwerty1234") { return(Tuple.Create(false, $"{password} is very easy. For amebs")); } ; return(Tuple.Create(true, "Password is Ok. User was created")); }); var result = verifyPassword.VerifyPassword(password); System.Console.WriteLine(result); }