mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add test
This commit is contained in:
parent
c7019cd851
commit
0219415194
@ -2,6 +2,7 @@ package cn.hutool.core.util;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -70,6 +71,17 @@ public class IdcardUtilTest {
|
||||
Assert.assertEquals(age2, 28);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAgeByIdCardTest2() {
|
||||
DateTime date = DateUtil.parse("2014-07-11");
|
||||
int age = IdcardUtil.getAgeByIdCard("321083200807112119", date);
|
||||
Console.log(age);
|
||||
|
||||
date = DateUtil.parse("2014-07-31");
|
||||
age = IdcardUtil.getAgeByIdCard("321083200807312119", date);
|
||||
Console.log(age);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getBirthByIdCardTest() {
|
||||
String birth = IdcardUtil.getBirthByIdCard(ID_18);
|
||||
|
Loading…
x
Reference in New Issue
Block a user