use of org.apache.poi.ss.formula.eval.StringEval in project poi by apache.
the class TestWorkdayFunction method testReturnNetworkdaysWithManyHolidays.
@Test
public void testReturnNetworkdaysWithManyHolidays() {
Calendar expCal = LocaleUtil.getLocaleCalendar(2009, 4, 5);
Date expDate = expCal.getTime();
ValueEval[] ve = { new StringEval(STARTING_DATE), new NumberEval(151), new MockAreaEval(FIRST_HOLIDAY, SECOND_HOLIDAY, THIRD_HOLIDAY) };
double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
Date actDate = DateUtil.getJavaDate(numberValue);
assertEquals(expDate, actDate);
}
use of org.apache.poi.ss.formula.eval.StringEval in project poi by apache.
the class TestWorkdayFunction method testReturnWorkdaysWhenStartIsWeekendAddingDays.
@Test
public void testReturnWorkdaysWhenStartIsWeekendAddingDays() {
Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 9, 7);
Date expDate = expCal.getTime();
ValueEval[] ve = { new StringEval("2013/10/06"), new NumberEval(1) };
double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
assertEquals(41554.0, numberValue, 0);
Date actDate = DateUtil.getJavaDate(numberValue);
assertEquals(expDate, actDate);
}
use of org.apache.poi.ss.formula.eval.StringEval in project poi by apache.
the class TestWorkdayFunction method testReturnWorkdaysWhenStartIsWeekendSubtractingDays.
@Test
public void testReturnWorkdaysWhenStartIsWeekendSubtractingDays() {
Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 9, 4);
Date expDate = expCal.getTime();
ValueEval[] ve = { new StringEval("2013/10/06"), new NumberEval(-1) };
double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
assertEquals(41551.0, numberValue, 0);
Date actDate = DateUtil.getJavaDate(numberValue);
assertEquals(expDate, actDate);
}
Aggregations