Exemplo n.º 1
0
        public void Div(int num1, int num2, int expected)
        {
            //Arrange
            var num = new UnitTestMethods();
            //Act
            var act = num.Div(num1, num2);

            //Assert
            Assert.Equal(expected, act);
        }
        public void Divide(int num1, int num2, int expected)
        {
            //Arrange
            var calculator = new UnitTestMethods();

            //Act
            var actual = calculator.Div(num1, num2);

            //Assert
            Assert.Equal(expected, actual);
        }
Exemplo n.º 3
0
        public void DivideException(int num1, int num2)
        {
            //Arrange
            var testFour = new UnitTestMethods();
            var expected = new DivideByZeroException();

            //Act
            //var actual = testFour.Divide(num1, num2);
            //Assert
            var answer = Assert.Throws <DivideByZeroException>(() => testFour.Div(9, 0));

            Assert.Equal(expected.Message, answer.Message);
        }