use of org.apache.poi.ss.formula.eval.NumberEval in project poi by apache.
the class TestEOMonth method checkValue.
private void checkValue(double startDate, int monthInc, double expectedResult) {
ValueEval[] ve = { new NumberEval(startDate), new NumberEval(monthInc) };
NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec);
assertEquals(expectedResult, result.getNumberValue(), 0);
}
use of org.apache.poi.ss.formula.eval.NumberEval in project poi by apache.
the class TestEDate method testBug56688.
@Test
public void testBug56688() {
EDate eDate = new EDate();
NumberEval result = (NumberEval) eDate.evaluate(new ValueEval[] { new NumberEval(1000), new RefEvalImplementation(new NumberEval(0)) }, null);
assertEquals(1000d, result.getNumberValue(), 0);
}
use of org.apache.poi.ss.formula.eval.NumberEval in project poi by apache.
the class TestEOMonth method testRefEvalStartDate.
@Test
public void testRefEvalStartDate() {
ValueEval[] ve = { new RefEvalImplementation(new NumberEval(DATE_1902_09_26)), new NumberEval(0) };
NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec);
assertEquals(DATE_1902_09_30, result.getNumberValue(), 0);
}
use of org.apache.poi.ss.formula.eval.NumberEval in project poi by apache.
the class TestEOMonth method testBug56688.
@Test
public void testBug56688() {
ValueEval[] ve = { new NumberEval(DATE_1902_09_26), new RefEvalImplementation(new NumberEval(0)) };
NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec);
assertEquals(DATE_1902_09_30, result.getNumberValue(), 0);
}
use of org.apache.poi.ss.formula.eval.NumberEval in project poi by apache.
the class TestEOMonth method testEOMonthZeroDate.
@Test
public void testEOMonthZeroDate() {
NumberEval result = (NumberEval) eOMonth.evaluate(new ValueEval[] { new NumberEval(0), new NumberEval(0) }, ec);
assertEquals("0 startDate is 1900-01-00", DATE_1900_01_31, result.getNumberValue(), 0);
result = (NumberEval) eOMonth.evaluate(new ValueEval[] { new NumberEval(0), new NumberEval(1) }, ec);
assertEquals("0 startDate is 1900-01-00", DATE_1900_02_28, result.getNumberValue(), 0);
}
Aggregations