This commit is contained in:
Looly
2021-05-14 16:58:33 +08:00
parent 415b2a285f
commit 2c1d10d952
3 changed files with 45 additions and 21 deletions

View File

@@ -11,25 +11,25 @@ import java.util.List;
import java.util.Set;
public class RandomUtilTest {
@Test
public void randomEleSetTest(){
Set<Integer> set = RandomUtil.randomEleSet(CollUtil.newArrayList(1, 2, 3, 4, 5, 6), 2);
Assert.assertEquals(set.size(), 2);
}
@Test
public void randomElesTest(){
List<Integer> result = RandomUtil.randomEles(CollUtil.newArrayList(1, 2, 3, 4, 5, 6), 2);
Assert.assertEquals(result.size(), 2);
}
@Test
public void randomDoubleTest() {
double randomDouble = RandomUtil.randomDouble(0, 1, 0, RoundingMode.HALF_UP);
Assert.assertTrue(randomDouble <= 1);
}
@Test
@Ignore
public void randomBooleanTest() {