完成 Quarter 和 YearQuarter 的单元测试

This commit is contained in:
2024-12-27 14:52:00 +08:00
parent f7f7bed848
commit 1a76f00b6a
5 changed files with 1110 additions and 70 deletions

View File

@@ -16,6 +16,7 @@
package xyz.zhouxy.plusone.commons.time;
import java.time.DateTimeException;
import java.time.Month;
import java.time.MonthDay;
import java.time.temporal.ChronoField;
@@ -171,7 +172,8 @@ public enum Quarter implements IWithIntCode {
// Getters end
public static int checkValidIntValue(int value) {
AssertTools.checkArgument(value >= 1 && value <= 4, () -> "Invalid value for Quarter: " + value);
AssertTools.checkCondition(value >= 1 && value <= 4,
() -> new DateTimeException("Invalid value for Quarter: " + value));
return value;
}