Esempio n. 1
0
        protected void btnDivide_Click(object sender, EventArgs e)
        {
            int num1   = Convert.ToInt32(txtNum1.Text);
            int num2   = Convert.ToInt32(txtNum2.Text);
            int result = CalculationOperation.Divide(num1, num2);

            lblResult.Text = result.ToString();
        }
Esempio n. 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");
        }