private static void ConfirmSubtotal(int function, double expected) { ValueEval[] values = new ValueEval[TEST_VALUES0.Length]; for (int i = 0; i < TEST_VALUES0.Length; i++) { values[i] = new NumberEval(TEST_VALUES0[i]); } AreaEval arg1 = EvalFactory.CreateAreaEval("C1:D5", values); ValueEval[] args = { new NumberEval(function), arg1 }; ValueEval result = new Subtotal().Evaluate(args, 0, 0); Assert.AreEqual(typeof(NumberEval), result.GetType()); Assert.AreEqual(expected, ((NumberEval)result).NumberValue, 0.0); }