public void Add_TestTrue() { calc objcalc = new calc(); objcalc.Add(20, 10); Assert.Equal(30, objcalc.result); }
public void Add_TestPass(double op1, double op2, double res) { calc objcalc = new calc(); objcalc.Add(op1, op2); Assert.Equal(res, objcalc.result); }
protected void Button1_Click(object sender, EventArgs e) { decimal oper1 = Convert.ToDecimal(TextBox1.Text); decimal oper2 = Convert.ToDecimal(TextBox2.Text); arithmeticresults.Text = mycalc.Add(oper1, oper2).ToString(); errorslabel.Text = ""; }
static void Main(string[] args) { var David = new Person(); David.VoorNaam = "David"; David.AchterNaam = " Duym"; David.Introduce(); var calc = new calc(); var result = calc.Add(1, 2); Console.WriteLine(result); }
public IActionResult Index(calc objParamCalc) { calc objCalc = new calc(); switch(objParamCalc.strOperator) { case "add" : objCalc.Add(objParamCalc.operand1,objParamCalc.operand2); break; case "sub" : objCalc.Subtract(objParamCalc.operand1,objParamCalc.operand2); break; } return View(objCalc); }