Exemplo n.º 1
0
        public void DivideOperatorThrowsException()
        {
            Operator divide = new DivideOperator().Divide;

            MeVariable[] arr = { new MeString("TEST"), new MeNumber(10) };
            Assert.IsFalse(divide.CanExecute(arr));
            TestUtils.CustomExceptionTest(() => divide.Execute(arr), typeof(MeContextException));
        }
Exemplo n.º 2
0
        public void DivideOperatorCanDivide()
        {
            Operator divide   = new DivideOperator().Divide;
            float    expected = 10.0f;

            MeVariable[] arr = { new MeNumber(100), new MeNumber(10) };
            Assert.IsTrue(divide.CanExecute(arr));
            float result = divide.Execute(arr).Get <float>();

            Assert.AreEqual(expected, result);
        }