/// <summary> /// Main Methode For User Input /// </summary> /// <param name="args"></param> static void Main(string[] args) { Console.WriteLine("welcome to the user registration problem"); Console.WriteLine("Enter the first name = "); string firstName = Console.ReadLine(); Console.WriteLine("Enter the last name = "); string lastName = Console.ReadLine(); Console.WriteLine("Enter the email = "); string email = Console.ReadLine(); Console.WriteLine("Enter the mobile pattern = "); string mobilePattern = Console.ReadLine(); Console.WriteLine("Enter the password = "******"Email sample validator"); EmailSamples emailSamples = new EmailSamples(); emailSamples.validateEmails(); }
/// <summary> /// Checks the first name. /// </summary> /// <param name="firstName">The first name.</param> /// <exception cref="UserRegistrationException">Invalid First Name Format</exception> public void checkFirstName(string firstName) { if (userRegistrationRegex.validateFirstName(firstName)) { Console.WriteLine("First Name is valid"); } else { throw new UserRegistrationException(UserRegistrationException.ExceptionType.INVALID_FIRSTNAME, "Invalid First Name Format"); } }