public void TestMethodRejected() { Assert.AreEqual("Rejected", PasswordChecker.Check("AA")); Assert.AreEqual("Rejected", PasswordChecker.Check("QUININE")); Assert.AreEqual("Rejected", PasswordChecker.Check("RINGRING")); Assert.AreEqual("Rejected", PasswordChecker.Check("COMMITTEE")); }
public void TestMethodAccepted() { Assert.AreEqual("Accepted", PasswordChecker.Check("A")); Assert.AreEqual("Accepted", PasswordChecker.Check("LONDON")); Assert.AreEqual("Accepted", PasswordChecker.Check("BIOGRAPHY")); Assert.AreEqual("Accepted", PasswordChecker.Check("APRICOT")); }
public void StartRegistration() { WriteLine("\t\t\t\tREGISTRATION"); Write("Login: "******"Sorry, enter your login correctly!\n"); Write("Login: "******"Password: "******"Phone number: "); checkPhone.Check(ref _phoneNumber); // user.PhoneNumber = _phoneNumber; _code = rnd.Next(1000, 9999); try { messageSender.SendMessage(_phoneNumber, _code); } catch { Write("Something went wrong! Try again."); Write("Phone number: "); checkPhone.Check(ref _phoneNumber); } user.PhoneNumber = _phoneNumber; Write("Enter code: "); _enterCode = int.Parse(ReadLine()); if (_enterCode == _code) { Write("Registration successfully completed!"); } else { while (!(_enterCode == _code)) { Write("Something went wrong!" + "Enter code: "); _enterCode = int.Parse(ReadLine()); } } UserTableService userTableService = new UserTableService(); userTableService.InsertUser(user); }