mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix boolean convert
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package cn.hutool.core.convert;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ConvertToBooleanTest {
|
||||
|
||||
@Test
|
||||
public void intToBooleanTest(){
|
||||
int a = 100;
|
||||
final Boolean aBoolean = Convert.toBool(a);
|
||||
Assert.assertTrue(aBoolean);
|
||||
|
||||
int b = 0;
|
||||
final Boolean bBoolean = Convert.toBool(b);
|
||||
Assert.assertFalse(bBoolean);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user