Ejemplo n.º 1
0
        public void Substraction_Test()
        {
            //Arrange section: Initialize the variables and set its value
            int expectedResult = 16;
            int num1           = 20;
            int num2           = 4;

            //Act section: call the intended method that we want to test
            int actionResult = CalculationOperation.Substract(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 substraction");
        }
Ejemplo n.º 2
0
        public void Subtraction_test()
        {
            //Arrange Section- we initialize variables and set its values.
            int expectedResult = 20;
            int num1           = 24;
            int num2           = 4;

            //Act Section- We invoke the method we want to test.
            int actualResult = CalculationOperation.Substract(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 subtraction");
        }