Esempio n. 1
0
        protected override object Calc(object[] args)
        {
            var val = args[0];
            var arr = (IFunArray)args[1];

            return(arr.Any(a => TypeHelper.AreEqual(a, val)));
        }
Esempio n. 2
0
        protected override object Calc(object a, object b)
        {
            var arr    = (IFunArray)a;
            var factor = b;
            int i      = 0;

            foreach (var element in arr)
            {
                if (TypeHelper.AreEqual(element, factor))
                {
                    return(i);
                }
                i++;
            }
            return(-1);
        }
Esempio n. 3
0
        public void ConstantEquationWithUpcast(string expr, object expected)
        {
            var result = expr.Calc().Get("y");

            Assert.IsTrue(TypeHelper.AreEqual(result, expected), $"result: {result} expected: {expected}");
        }
Esempio n. 4
0
 protected override object Calc(object a, object b)
 => TypeHelper.AreEqual(a, b);