/// <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 mobile. /// </summary> /// <param name="mobileFormat">The mobile format.</param> /// <exception cref="UserRegistrationException">Invalid Mobile Number Format</exception> public void checkMobile(string mobileFormat) { if (userRegistrationRegex.validateMobileFormat(mobileFormat)) { Console.WriteLine("mobile format is valid"); } else { throw new UserRegistrationException(UserRegistrationException.ExceptionType.INVALID_MOBILE_NUMBER, "Invalid Mobile Number Format"); } }