Exemple #1
0
        public void EmailTest()
        {
            bool actual;
            Dictionary <string, bool> testEmail = new Dictionary <string, bool>();

            testEmail.Add("", false);
            testEmail.Add("qwahfynfjndy", false);
            testEmail.Add("   @   ", false);
            testEmail.Add("*****@*****.**", true);
            testEmail.Add("ывфывфы@вывыю.выв", false);
            testEmail.Add("qew@qww", true);
            foreach (string element in testEmail.Keys)
            {
                actual = CheckString.Email(element);
                Assert.AreEqual(testEmail[element], actual, "Строка на входе = \"" + element + "\"");
            }
        }
Exemple #2
0
 private void TextBoxEmail_TextChanged(object sender, EventArgs e)
 {
     tbEmail.BackColor = CheckString.GetColorAfterCheckString(tbEmail.Text, CheckString.Email(tbEmail.Text));
 }