コード例 #1
0
ファイル: Addition.aspx.cs プロジェクト: mnrs1987/SampleRepo
 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;
     }
 }
コード例 #2
0
 public void Addition()
 {
     mathlib.math math = new math();
     Assert.AreEqual(20, math.Add(10, 10), "Additon values are equal and testing successful");
 }