private void button1_Click(object sender, EventArgs e) { string status = "not sent"; DateTime time = DateTime.Now; string data = time.ToShortDateString(); string name = textBox2.Text.Replace(" ", ""); string mname = textBox3.Text.Replace(" ", ""); string sname = textBox1.Text.Replace(" ", ""); string address = textBox4.Text; string hemail = textBox5.Text; string email = textBox5.Text + comboBox1.SelectedItem; string hnumber = textBox6.Text; string number = comboBox2.SelectedItem + textBox6.Text; if (inputCheck.OrderCheck(name, mname, sname, address, hemail, email, hnumber)) { name = NormalStr(textBox2.Text); mname = NormalStr(textBox3.Text); sname = NormalStr(textBox1.Text); address = NormalAddress(textBox4.Text); bd.WorkWithBD(String.Format("INSERT INTO Orders VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}',{8})", name, mname, sname, address, email, data, number, status, idBucket)); seccessList.SeccessMessage(4); } ChangeOrderForm(); }
public void OrderCheck_NotCorrectInputs_FalseReturned(string n, string mn, string s, string a, string e, string fE, string numb) { string name = n; string mname = mn; string surname = s; string address = a; string email = e; string fullEmail = fE; string number = numb; CorrectInputCheck inputCheck = GetInputCheck(); bool actual = inputCheck.OrderCheck(name, mname, surname, address, email, fullEmail, number); Assert.IsFalse(actual); }
public void OrderCheck_CorrectInputs_TrueReturned() { string name = "Yura"; string mname = "Michailovich"; string surname = "Yarmoshuk"; string address = "Doroshevica, 3, 230"; string email = "xpblll"; string fullEmail = "*****@*****.**"; string number = "1862949"; CorrectInputCheck inputCheck = GetInputCheck(); bool actual = inputCheck.OrderCheck(name, mname, surname, address, email, fullEmail, number); Assert.IsTrue(actual); }