use of org.apache.poi.ss.formula.OperationEvaluationContext in project poi by apache.
the class TestBin2Dec method testEvalOperationEvaluationContextFails.
public void testEvalOperationEvaluationContextFails() {
OperationEvaluationContext ctx = createContext();
ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0), ctx.getRefEval(0, 0) };
ValueEval result = new Bin2Dec().evaluate(args, ctx);
assertEquals(ErrorEval.class, result.getClass());
assertEquals(ErrorEval.VALUE_INVALID, result);
}
use of org.apache.poi.ss.formula.OperationEvaluationContext in project poi by apache.
the class TestBin2Dec method testRefs.
public void testRefs() {
OperationEvaluationContext ctx = createContext();
ValueEval[] args = new ValueEval[] { ctx.getRefEval(0, 0) };
ValueEval result = new Bin2Dec().evaluate(args, -1, -1);
assertEquals(NumberEval.class, result.getClass());
assertEquals("0", ((NumberEval) result).getStringValue());
}
Aggregations