public void SumarTest()
 {
     Operaciones target = new Operaciones();
     int num1 = 4;
     int num2 = 1;
     int expected = 5;
     int actual;
     actual = target.Sumar(num1, num2);
     Assert.AreEqual(expected, actual);
     // Assert.Inconclusive("Compruebe la exactitud de este método de prueba.");
 }
Example #2
0
        private void btnSuma_Click(object sender, EventArgs e)
        {
            int num1 = Convert.ToInt32(mskNum1.Text);
            int num2 = Convert.ToInt32(mskNum2.Text);

            Operaciones operaciones = new Operaciones();

            try
            {
                int suma = operaciones.Sumar(num1, num2);
                lblResultado.Text = suma.ToString();
            }
            catch (Exception ex)
            {
                lblResultado.Text = ex.Message;
            }
        }
 public void SumarExcepcionElSegundoValorMayorQueIntMaxValue()
 {
     Operaciones target = new Operaciones();
     target.Sumar(1, int.MaxValue);
 }
 public void SumarExcepcionElPrimerValorMayorQueIntMaxValue()
 {
     Operaciones target = new Operaciones();
     target.Sumar(int.MaxValue, 1);
 }