summaryrefslogtreecommitdiff
path: root/examples/09-list/output/java/src
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-09-04 15:07:59 +0100
committerMichael Williamson <mike@zwobble.org>2026-09-04 15:07:59 +0100
commit8b1ee9a26a378a4456e800be314ab765be94b368 (patch)
tree415ca73ed399eba23b5f8b56392538e73b3d5afd /examples/09-list/output/java/src
parent26d06c662fe35c32d9b777b2c624730cb8bee53b (diff)
Move custom code example to be earlier
Diffstat (limited to 'examples/09-list/output/java/src')
-rw-r--r--examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java b/examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java
new file mode 100644
index 0000000..e1528b5
--- /dev/null
+++ b/examples/09-list/output/java/src/test/java/org/zwobble/example/PointTests.java
@@ -0,0 +1,32 @@
+package org.zwobble.example;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
+import java.util.List;
+import org.zwobble.example.types.point.Path;
+import org.zwobble.example.types.point.Point;
+
+public class PointTests {
+ @Test
+ public void canCreatePathWithConstructor() {
+ Path path = new Path(List.of(
+ new Point(10, 25),
+ new Point(25, 10)
+ ));
+
+ assertEquals(path.points().size(), 2);
+ }
+
+ @Test
+ public void canCreatePathWithBuilder() {
+ Path path = Path.arbitrary()
+ .addPoint(new Point(10, 25))
+ .addPoint(new Point(25, 10))
+ .build();
+
+ assertEquals(path, new Path(List.of(
+ new Point(10, 25),
+ new Point(25, 10)
+ )));
+ }
+}