@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()); } }
@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(); } }
@Test public void countSpace() throws Exception { Space spaces[] = pointGenerator.divideSpace(rectSpace, divide); assertEquals(divide * divide, spaces.length); }
@Test public void isPointDuplicate() throws Exception { List<Point> pointList = pointGenerator.getPointList(rectSpace, pointCnt, divide); long uniqueCount = pointList.stream().distinct().count(); assertEquals(pointCnt, uniqueCount); }
@Test public void countEntirePointCircle() throws Exception { List<Point> pointList = pointGenerator.getPointList(circleSpace, pointCnt, divide); assertEquals(pointCnt, pointList.size()); }