mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix test
This commit is contained in:
parent
8a5efb84da
commit
dd3a7a39f1
@ -5,8 +5,7 @@ import java.util.Date;
|
|||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateBetween;
|
import cn.hutool.core.date.BetweenFormater.Level;
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
|
|
||||||
public class DateBetweenTest {
|
public class DateBetweenTest {
|
||||||
|
|
||||||
@ -47,4 +46,12 @@ public class DateBetweenTest {
|
|||||||
long betweenMonth2 = new DateBetween(start2, end2).betweenMonth(false);
|
long betweenMonth2 = new DateBetween(start2, end2).betweenMonth(false);
|
||||||
Assert.assertEquals(11, betweenMonth2);
|
Assert.assertEquals(11, betweenMonth2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void betweenMinuteTest() {
|
||||||
|
Date date1 = DateUtil.parse("2017-03-01 20:33:23");
|
||||||
|
Date date2 = DateUtil.parse("2017-03-01 23:33:23");
|
||||||
|
String formatBetween = DateUtil.formatBetween(date1, date2, Level.SECOND);
|
||||||
|
Assert.assertEquals("3小时", formatBetween);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user