//[Test]
        public void ValidEmailsTest()
        {
            IInputValidationService service     = new InputValidationService();
            List <string>           validEmails = FileUtils.FileToStringList(TestFiles.ValidEmails);

            foreach (string email in validEmails)
            {
                Assert.DoesNotThrow(() =>
                {
                    service.ValidateEmail(email);
                });
            }
        }
예제 #2
0
        public static Consultant GetValidConsultant()
        {
            Consultant             consultant = GetConsultant();
            InputValidationService service    = new InputValidationService();

            try
            {
                service.ValidateUsername(consultant.Username);
                service.ValidateFirstName(consultant.FirstName);
                service.ValidateLastName(consultant.LastName);
                service.ValidateEmail(consultant.Email);
                service.ValidateContact(consultant.Contact);
            }
            catch (InputValidationException e)
            {
                Logger.Debug(e);
                consultant = null;
                throw;
            }

            return(consultant);
        }
예제 #3
0
        public static Account GetValidAccount()
        {
            Account account = GetAccount();
            InputValidationService service = new InputValidationService();

            try
            {
                service.ValidateUsername(account.Username);
                service.ValidateFirstName(account.FirstName);
                service.ValidateLastName(account.LastName);
                service.ValidateEmail(account.Email);
                service.ValidateContact(account.Contact);
            }
            catch (InputValidationException e)
            {
                Logger.Debug(e);
                account = null;
                throw;
            }

            return(account);
        }