diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-14 18:29:39 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-14 18:29:39 +0100 |
| commit | 2d44c6f5790f4ed1f143adde92f9aeb25a274d66 (patch) | |
| tree | d49d9778252322c68e842c335a5e45635cb52aa6 /examples/05-list/output/java-junit | |
| parent | 43d1f5df6c9f298621c665bd6d5d9450822a8edc (diff) | |
Convert example 05-list to use JUnit
Diffstat (limited to 'examples/05-list/output/java-junit')
3 files changed, 35 insertions, 0 deletions
diff --git a/examples/05-list/output/java-junit/.gitignore b/examples/05-list/output/java-junit/.gitignore new file mode 100644 index 0000000..ff511d4 --- /dev/null +++ b/examples/05-list/output/java-junit/.gitignore @@ -0,0 +1,2 @@ +/src/gen/ +/target/ diff --git a/examples/05-list/output/java-junit/pom.xml b/examples/05-list/output/java-junit/pom.xml new file mode 120000 index 0000000..445fa65 --- /dev/null +++ b/examples/05-list/output/java-junit/pom.xml @@ -0,0 +1 @@ +../../../templates/java-junit/pom.xml
\ No newline at end of file diff --git a/examples/05-list/output/java-junit/src/test/java/org/zwobble/example/PointTests.java b/examples/05-list/output/java-junit/src/test/java/org/zwobble/example/PointTests.java new file mode 100644 index 0000000..e1528b5 --- /dev/null +++ b/examples/05-list/output/java-junit/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) + ))); + } +} |
