Exemplo n.º 1
0
        /// <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();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Checks the last name.
 /// </summary>
 /// <param name="lastName">The last name.</param>
 /// <exception cref="UserRegistrationException">Invalid Last Name Format</exception>
 public void checkLastName(string lastName)
 {
     if (userRegistrationRegex.validateLastName(lastName))
     {
         Console.WriteLine("Last Name is valid");
     }
     else
     {
         throw new UserRegistrationException(UserRegistrationException.ExceptionType.INVALID_LASTNAME, "Invalid Last Name Format");
     }
 }