Skip to content

Commit 354bc0b

Browse files
Add unit test for VoronoiDiagram edge computation
1 parent d8d9d40 commit 354bc0b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.thealgorithms.geometry;
2+
3+
import static org.junit.jupiter.api.Assertions.*;
4+
import java.awt.geom.Line2D;
5+
import java.util.Arrays;
6+
import java.util.List;
7+
import org.junit.jupiter.api.Test;
8+
9+
public class VoronoiDiagramTest {
10+
11+
@Test
12+
void testVoronoiEdges() {
13+
List<Point> points = Arrays.asList(
14+
new Point(0, 0), new Point(1, 0),
15+
new Point(0, 1)
16+
);
17+
18+
List<Line2D.Double> edges = VoronoiDiagram.computeVoronoiEdges(points);
19+
assertFalse(edges.isEmpty());
20+
assertTrue(edges.size() > 0);
21+
}
22+
}

0 commit comments

Comments
 (0)