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
34dc797d23
commit
51e4a14388
@ -5,6 +5,7 @@ import org.junit.Assert;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PartitionTest {
|
public class PartitionTest {
|
||||||
@ -53,4 +54,17 @@ public class PartitionTest {
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSize() {
|
||||||
|
final List<Integer> emptyList = Collections.emptyList();
|
||||||
|
Partition<Integer> partition = new Partition<>(emptyList, 10);
|
||||||
|
|
||||||
|
Assert.assertTrue(partition.isEmpty());
|
||||||
|
|
||||||
|
final List<Integer> singletonList = Collections.singletonList(1);
|
||||||
|
partition = new Partition<>(singletonList, 10);
|
||||||
|
Assert.assertFalse(partition.isEmpty());
|
||||||
|
Assert.assertEquals(1, partition.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user