private static void ConfirmCountBlank(int expected, AreaEval range) { ValueEval[] args = { range }; double result = NumericFunctionInvoker.Invoke(new Countblank(), args); Assert.AreEqual(expected, result, 0); }
private static void ConfirmRowsFunc(String areaRefStr, int nCols, int nRows) { ValueEval[] args = { EvalFactory.CreateAreaEval(areaRefStr, new ValueEval[nCols * nRows]), }; double actual = NumericFunctionInvoker.Invoke(new Rows(), args); Assert.AreEqual(nRows, actual, 0D); }
private static void ConfirmCountIf(int expected, AreaEval range, ValueEval criteria) { ValueEval[] args = { range, criteria, }; double result = NumericFunctionInvoker.Invoke(new Countif(), args); Assert.AreEqual(expected, result, 0); }
public void TestRows() { ConfirmRowsFunc("A1:F1", 6, 1); ConfirmRowsFunc("A1:C2", 3, 2); ConfirmRowsFunc("A1:B3", 2, 3); ConfirmRowsFunc("A1:A6", 1, 6); ValueEval[] args = { EvalFactory.CreateRefEval("C5"), }; double actual = NumericFunctionInvoker.Invoke(new Rows(), args); Assert.AreEqual(1, actual, 0D); }
public void TestCol() { Function target = new Column(); { ValueEval[] args = { EvalFactory.CreateRefEval("C5"), }; double actual = NumericFunctionInvoker.Invoke(target, args); Assert.AreEqual(3, actual, 0D); } { ValueEval[] args = { EvalFactory.CreateAreaEval("E2:H12", new ValueEval[44]), }; double actual = NumericFunctionInvoker.Invoke(target, args); Assert.AreEqual(5, actual, 0D); } }
public void TestRow() { //throw new NotImplementedException(); Function target = new Row(); { ValueEval[] args = { EvalFactory.CreateRefEval("C5"), }; double actual = NumericFunctionInvoker.Invoke(target, args); Assert.AreEqual(5, actual, 0D); } { ValueEval[] args = { EvalFactory.CreateAreaEval("E2:H12", new ValueEval[44]), }; double actual = NumericFunctionInvoker.Invoke(target, args); Assert.AreEqual(2, actual, 0D); } }
public void TestCountIfWithCriteriaReference() { ValueEval[] values = { new NumberEval(22), new NumberEval(25), new NumberEval(21), new NumberEval(25), new NumberEval(25), new NumberEval(25), }; AreaEval arg0 = EvalFactory.CreateAreaEval("C1:C6", values); ValueEval criteriaArg = EvalFactory.CreateRefEval("A1", new NumberEval(25)); ValueEval[] args = { arg0, criteriaArg, }; double actual = NumericFunctionInvoker.Invoke(new Countif(), args); Assert.AreEqual(4, actual, 0D); }
private static void ConfirmCountA(int expected, ValueEval[] args) { double result = NumericFunctionInvoker.Invoke(new Counta(), args); Assert.AreEqual(expected, result, 0); }