コード例 #1
0
 @Test
 public void countPointInSpace() throws Exception {
   Space spaces[] = pointGenerator.divideSpace(rectSpace, divide);
   for (Space space : spaces) {
     pointGenerator.generate(space, pointCnt / (divide * divide));
     assertEquals(pointCnt / (divide * divide), space.getPointList().size());
   }
 }
コード例 #2
0
 @Test
 public void checkPointBaundary() throws Exception {
   List<Point> pointList = pointGenerator.getPointList(rectSpace, pointCnt, divide);
   for (Point point : pointList) {
     if (point.x() < 0 && point.x() > width) fail();
     if (point.y() < 0 && point.y() > height) fail();
   }
 }
コード例 #3
0
 @Test
 public void countSpace() throws Exception {
   Space spaces[] = pointGenerator.divideSpace(rectSpace, divide);
   assertEquals(divide * divide, spaces.length);
 }
コード例 #4
0
 @Test
 public void isPointDuplicate() throws Exception {
   List<Point> pointList = pointGenerator.getPointList(rectSpace, pointCnt, divide);
   long uniqueCount = pointList.stream().distinct().count();
   assertEquals(pointCnt, uniqueCount);
 }
コード例 #5
0
 @Test
 public void countEntirePointCircle() throws Exception {
   List<Point> pointList = pointGenerator.getPointList(circleSpace, pointCnt, divide);
   assertEquals(pointCnt, pointList.size());
 }