示例#1
0
        public void Division_Test()
        {
            //Arrange section: Initialize the variables and set its value
            int expectedResult = 5;
            int num1           = 20;
            int num2           = 4;

            //Act section: call the intended method that we want to test
            int actionResult = CalculationOperation.Divide(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 division");
        }
示例#2
0
        public void Division_test()
        {
            //Arrange Section- we initialize variables and set its values.
            int expectedResult = 4;
            int num1           = 24;
            int num2           = 6;

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