public void Multiplication_Test() { //Arrange section: Initialize the variables and set its value int expectedResult = 80; int num1 = 20; int num2 = 4; //Act section: call the intended method that we want to test int actionResult = CalculationOperation.Multiply(num1, num2); //Assert section - We verify weather our test suceeded or not using Assert class Assert.AreEqual(expectedResult, actionResult); Console.WriteLine("This is test method for multiplication"); }
public void Multiply_test() { //Arrange Section- we initialize variables and set its values. int expectedResult = 24; int num1 = 6; int num2 = 4; //Act Section- We invoke the method we want to test. int actualResult = CalculationOperation.Multiply(num1, num2); //Assert Section- we verify the method that we want to verify if the emthod behaves as per expected Assert.AreEqual(expectedResult, actualResult); Console.WriteLine("This is the test method for addition"); }