private void button1_Click(object sender, EventArgs e) { try { int value = Int32.Parse(textBox1.Text); if (value < 0) { textBox2.Text = "Incorrect Format"; } else { textBox2.Text = PrimeClass.isPrime(value).ToString(); } } catch { textBox2.Text = "Incorrect Format"; } }
public void PrimeService() { Assert.IsFalse(PrimeClass.isPrime(10), "10 should not be prime"); }
public void IsPrime_ValuesLessThan2_ReturnFalse(int value, bool result) { Assert.AreEqual(PrimeClass.isPrime(value), result); }