public void Given_valid_arguements_when_Add_invoke_Then_Valid_Result_Asserted() { calculate.Addition(10, 20); calculate.Addition(10, 20); calculate.Addition(10, 20); calculate.Addition(10, 20); _mockWrapper.Verify(fakeNeighbour => fakeNeighbour.write("Add method Invoked"), Moq.Times.Exactly(4)); }
public void AdditionTests() { Calculate cal = new Calculate(); cal.Addition(10, 5); Console.WriteLine("Testing 10+5"); Assert.AreEqual(15, cal.Output()); cal.Addition(-5, 10); Console.WriteLine("Testing -5+10"); //Assert.AreEqual(15, cal.Output()); }
static void Main(string[] args) { Calculate.Addition(10, 50); Calculate objCal = new Calculate(); objCal.Multiply(10, 20); }
static void Main(string[] args) { Calculate calculate = new Calculate(); result = calculate.Addition(25, 36); Console.WriteLine("Result " + result); }
private void Button_Click(object sender, RoutedEventArgs e) { CheckValues(); if (calc.isIncorrect == false) { Output.Text = calc.Addition().ToString(); } }
static void Main(string[] args) { Calculate c = new Calculate(2, 3); c.Addition(); Console.WriteLine(c); }
public void AdditionReturnFour() { ////Arrange Calculate calculation = new Calculate(); //ACT double number = calculation.Addition(2, 2); //ASSERT Assert.Equal(4, number); }
protected void equalsbutton_Click(object sender, EventArgs e) { if (numberdisplay.Text == string.Empty) { Response.Write("<script>alert('Brak danych')</script>"); } else { ViewState["x2"] = numberdisplay.Text; numberdisplay.Text = string.Empty; try { if ((string)ViewState["Operation"] == "Addition") { numberdisplay.Text = _Calculate.Addition(Convert.ToInt32(ViewState["x1"]), Convert.ToInt32(ViewState["x2"])).ToString(); } else if ((string)ViewState["Operation"] == "Subtraction") { numberdisplay.Text = _Calculate.Subtraction(Convert.ToInt32(ViewState["x1"]), Convert.ToInt32(ViewState["x2"])).ToString(); } else if ((string)ViewState["Operation"] == "Multiplication") { numberdisplay.Text = _Calculate.Multiply(Convert.ToInt32(ViewState["x1"]), Convert.ToInt32(ViewState["x2"])).ToString(); } else if ((string)ViewState["Operation"] == "Division") { if (Convert.ToInt32(ViewState["x2"]) == 0) { Response.Write("<script>alert('Nie dziel przez 0!')</script>"); } numberdisplay.Text = _Calculate.Division(Convert.ToInt32(ViewState["x1"]), Convert.ToInt32(ViewState["x2"])).ToString(); } else { Response.Write("<script>alert('Brak wybranej operacji')</script>"); } } catch (FormatException) { Response.Write("<script>alert('Zły format danych')</script>"); } } }
public void AdditionTest() { _cal.Addition(); Assert.IsTrue(_cal.Answer == 5); }
public void TestAddition() { Assert.AreEqual(5, Calculate.Addition(2, 3)); }
public double Add(double num1, double num2) { Calculate add = new Calculate(); return(add.Addition(num1, num2)); }