Пример #1
0
        private bool ValidateForm()
        {
            var result = true;

            result = !ValidationHelper.ValidateTextFiled(LoginBox.Text.Length > 0, LoginBox) ? false : result;
            result = !ValidationHelper.ValidateTextFiled(NameBox.Text.Length > 0, NameBox) ? false : result;
            result = !ValidationHelper.ValidateTextFiled(PhoneBox.Text.Length > 0 && ConstraintHelper.ValidatePhoneNumber(PhoneBox.Text), PhoneBox) ? false : result;
            result = !ValidationHelper.ValidateTextFiled(ConstraintHelper.ValidateEmail(EmailBox.Text), EmailBox) ? false : result;
            return(result);
        }
Пример #2
0
 public void TestEmail()
 {
     Assert.AreEqual(true, ConstraintHelper.ValidateEmail("*****@*****.**"));
     Assert.AreEqual(false, ConstraintHelper.ValidateEmail("[email protected]"));
     Assert.AreEqual(false, ConstraintHelper.ValidateEmail("testcms.com"));
     Assert.AreEqual(false, ConstraintHelper.ValidateEmail("@cms.com"));
     Assert.AreEqual(false, ConstraintHelper.ValidateEmail("[email protected]"));
     Assert.AreEqual(false, ConstraintHelper.ValidateEmail("test@cmscom"));
     Assert.AreEqual(false, ConstraintHelper.ValidateEmail("test@cms."));
     Assert.AreEqual(false, ConstraintHelper.ValidateEmail("testcmscom"));
 }