重构部分代码;修改 API

This commit is contained in:
2024-08-26 10:24:07 +08:00
parent c92f4fbd5c
commit fd1126be9b
4 changed files with 101 additions and 123 deletions

View File

@@ -42,13 +42,13 @@ public class YearQuarterTests {
Quarter quarter = Quarter.of(qrtr);
YearQuarter yearQuarter = YearQuarter.of(year, quarter);
LocalDate expectedStartDate = quarter.getStartMonthDay().atYear(year);
LocalDate expectedStartDate = quarter.firstMonthDay().atYear(year);
log.info("{} - expectedStartDate: {}", yearQuarter, expectedStartDate);
LocalDate expectedEndDate = quarter.getLastMonthDay().atYear(year);
LocalDate expectedEndDate = quarter.lastMonthDay().atYear(year);
log.info("{} - expectedEndDate: {}", yearQuarter, expectedEndDate);
assertEquals(expectedStartDate, yearQuarter.getStartDate());
assertEquals(expectedEndDate, yearQuarter.getLastDate());
assertEquals(expectedStartDate, yearQuarter.firstDate());
assertEquals(expectedEndDate, yearQuarter.lastDate());
}
}
}