mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add methods
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.lang;
|
||||
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AssertTest {
|
||||
@@ -35,4 +36,27 @@ public class AssertTest {
|
||||
//noinspection ConstantConditions
|
||||
Assert.isTrue(i > 0, ()-> new IndexOutOfBoundsException("relation message to return"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void equalsTest() {
|
||||
//String a="ab";
|
||||
//final String b = new String("abc");
|
||||
final String a = null;
|
||||
final String b = null;
|
||||
Assert.equals(a, b);
|
||||
Assert.equals(a, b, "{}不等于{}", a, b);
|
||||
Assert.equals(a, b, () -> new RuntimeException(StrUtil.format("{}和{}不相等", a, b)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notEqualsTest() {
|
||||
//String c="19";
|
||||
//final String d = new String("19");
|
||||
final String c = null;
|
||||
final String d = "null";
|
||||
//Assert.notEquals(c,d);
|
||||
//Assert.notEquals(c,d,"{}等于{}",c,d);
|
||||
Assert.notEquals(c, d, () -> new RuntimeException(StrUtil.format("{}和{}相等", c, d)));
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user