Ejemplo n.º 1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         math  math   = new math();
         Int32 value1 = Convert.ToInt32(addValue1.Text.ToString());
         Int32 value2 = Convert.ToInt32(addValue2.Text.ToString());
         Int32 sum    = math.Add(value1, value2);
         sumValue.Text      = "Sum of two values are : " + sum.ToString();
         sumValue.ForeColor = System.Drawing.Color.White;
     }
     catch
     {
         sumValue.Text      = "Input Error";
         sumValue.ForeColor = System.Drawing.Color.Red;
     }
 }
Ejemplo n.º 2
0
 public void Addition()
 {
     mathlib.math math = new math();
     Assert.AreEqual(20, math.Add(10, 10), "Additon values are equal and testing successful");
 }