From 4fda4a04554b56d16c46456d5d4cabf86e6a8c22 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 11 Feb 2022 00:34:31 +0000 Subject: [PATCH] [bug-65879] add tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897955 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/formula/atp/TestWorkdayCalculator.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/poi/src/test/java/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java b/poi/src/test/java/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java index 5302595a70..b164c9ef0e 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/atp/TestWorkdayCalculator.java @@ -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 -- 2.39.5