Exemplo n.º 1
0
        public void MinFunctionThrows()
        {
            Function func = new MinFunction().Min;

            MeVariable[] input = { new MeString("test"), new MeNumber(55), new MeNumber(30) };
            Assert.IsFalse(func.CanExecute(input));
            TestUtils.CustomExceptionTest(() => func.Execute(input), typeof(MeContextException));
        }
Exemplo n.º 2
0
        public void MinFunctionCanExecute()
        {
            Function func     = new MinFunction().Min;
            float    expected = -10.0f;

            MeVariable[] input = { new MeNumber(14), new MeNumber(55), new MeNumber(expected) };
            Assert.IsTrue(func.CanExecute(input));
            float result = func.Execute(input).Get <float>();

            Assert.AreEqual(expected, result);
        }