Esempio n. 1
0
 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";
     }
 }
Esempio n. 2
0
 public void PrimeService()
 {
     Assert.IsFalse(PrimeClass.isPrime(10), "10 should not be prime");
 }
Esempio n. 3
0
 public void IsPrime_ValuesLessThan2_ReturnFalse(int value, bool result)
 {
     Assert.AreEqual(PrimeClass.isPrime(value), result);
 }