Exemplo n.º 1
0
        private static ValueEval Evaluate(HSSFFunctions.Function instance, params double[] dArgs)
        {
            ValueEval[] evalArgs;
            evalArgs = new ValueEval[dArgs.Length];
            for (int i = 0; i < evalArgs.Length; i++)
            {
                evalArgs[i] = new NumberEval(dArgs[i]);
            }
            ValueEval r = instance.Evaluate(evalArgs, -1, (short)-1);

            return(r);
        }
Exemplo n.º 2
0
        private static bool EvalStringCmp(String a, String b, HSSFFunctions.Function cmpOp)
        {
            ValueEval[] args =
            {
                new StringEval(a),
                new StringEval(b),
            };
            ValueEval result = Evaluate(cmpOp, args, 10, 20);

            Assert.AreEqual(typeof(BoolEval), result.GetType());
            BoolEval be = (BoolEval)result;

            return(be.BooleanValue);
        }
Exemplo n.º 3
0
 private static ValueEval Evaluate(HSSFFunctions.Function oper, ValueEval[] args, int srcRowIx, int srcColIx)
 {
     return(oper.Evaluate(args, srcRowIx, (short)srcColIx));
 }
Exemplo n.º 4
0
        private static void CheckEval(double expectedResult, HSSFFunctions.Function instance, params double[] dArgs)
        {
            NumberEval result = (NumberEval)Evaluate(instance, dArgs);

            Assert.AreEqual(expectedResult, result.NumberValue);
        }
Exemplo n.º 5
0
        private static void CheckEval(bool expectedResult, HSSFFunctions.Function instance, params double[] dArgs)
        {
            BoolEval result = (BoolEval)Evaluate(instance, dArgs);

            Assert.AreEqual(expectedResult, result.BooleanValue);
        }