[bug-65879] add tests

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897955 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-02-11 00:34:31 +00:00
parent 7d7a088f47
commit 4fda4a0455
1 changed files with 9 additions and 1 deletions

View File

@ -87,9 +87,17 @@ class TestWorkdayCalculator {
@Test
void testCalculateWorkdaysNumberOfDays() {
double start = 41553.0;
double start = DateUtil.getExcelDate(d(2013, 10, 4));
assertEquals(41551.0, start);
int days = 1;
assertEquals(d(2013, 10, 7), WorkdayCalculator.instance.calculateWorkdays(start, days, new double[0]));
assertEquals(d(2013, 10, 7), WorkdayCalculator.instance.calculateWorkdays(start + 1, days, new double[0]));
assertEquals(d(2013, 10, 7), WorkdayCalculator.instance.calculateWorkdays(start + 2, days, new double[0]));
assertEquals(d(2013, 10, 5),
WorkdayCalculator.instance.calculateWorkdays(start, days, 5, new double[0]));
assertEquals(d(2013, 10, 3), WorkdayCalculator.instance.calculateWorkdays(start, -1, new double[0]));
}
@Test