Example #1
0
        public void RetornaExeptionNaDivisaoPorZero()
        {
            //Given
            decimal first  = 10;
            decimal second = 0;

            var mathOperator = new MathOperator();

            //When
            //Then
            Assert.Throws <DivideByZeroException>(() => mathOperator.Divide(first, second));
        }
Example #2
0
        public void DeveDarErroAoTentarDividirPorDoisNumeros()
        {
            //Given
            var     first        = 100;
            var     second       = 2;
            var     mathOperator = new MathOperator();
            decimal expected     = 50;
            decimal result;

            //When
            result = mathOperator.Divide(first, second);
            //Then
            Assert.Equal(expected, result);
        }