Esempio n. 1
0
        public void ArithmeticOpTests_Divide_SmallThanTolerance_ShouldThrow()
        {
            var op          = new ArithmeticOp(Operator.Division);
            var denominator = AppConstants.Tolerance - 1e-5;

            Assert.Throws <DivideByZeroException>(() => op.Divide(1, denominator));
        }
Esempio n. 2
0
        public void ArithmeticOpTests_Divide_BiggerThanTolerance_Pass()
        {
            var op          = new ArithmeticOp(Operator.Division);
            var denominator = AppConstants.Tolerance + 1e-5;
            var result      = op.Divide(1, denominator);

            Assert.Equal(1 / denominator, result);
        }