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 + "\""); } }
private void TextBoxEmail_TextChanged(object sender, EventArgs e) { tbEmail.BackColor = CheckString.GetColorAfterCheckString(tbEmail.Text, CheckString.Email(tbEmail.Text)); }