diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-09-21 20:57:36 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-09-21 20:57:36 +0100 |
| commit | 2bf02785d9aef8b7b265d41cd45e2519a7e04bb4 (patch) | |
| tree | 72765bd081280ca0a36ad5f820a0659b35ff66ee /examples/15-struct-generic/output/java | |
| parent | 8b601565c9e14aa673dca94bd79c84ad6f2f04f3 (diff) | |
Support Option in typescript-types
Diffstat (limited to 'examples/15-struct-generic/output/java')
3 files changed, 46 insertions, 0 deletions
diff --git a/examples/15-struct-generic/output/java/.gitignore b/examples/15-struct-generic/output/java/.gitignore new file mode 100644 index 0000000..ff511d4 --- /dev/null +++ b/examples/15-struct-generic/output/java/.gitignore @@ -0,0 +1,2 @@ +/src/gen/ +/target/ diff --git a/examples/15-struct-generic/output/java/pom.xml b/examples/15-struct-generic/output/java/pom.xml new file mode 120000 index 0000000..445fa65 --- /dev/null +++ b/examples/15-struct-generic/output/java/pom.xml @@ -0,0 +1 @@ +../../../templates/java-junit/pom.xml
\ No newline at end of file diff --git a/examples/15-struct-generic/output/java/src/test/java/org/zwobble/example/PointTests.java b/examples/15-struct-generic/output/java/src/test/java/org/zwobble/example/PointTests.java new file mode 100644 index 0000000..fba31c7 --- /dev/null +++ b/examples/15-struct-generic/output/java/src/test/java/org/zwobble/example/PointTests.java @@ -0,0 +1,43 @@ +package org.zwobble.example; + +import org.junit.jupiter.api.Test; +import org.zwobble.example.types.point.Line; +import org.zwobble.example.types.point.LineDrawing; +import org.zwobble.example.types.point.Point2D; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.zwobble.example.types.point.LineDrawingMatcher.isLineDrawing; +import static org.zwobble.example.types.point.LineMatcher.isLine; +import static org.zwobble.example.types.point.Point2DMatcher.isPoint2D; +import static org.zwobble.precisely.AssertThat.assertThat; +import static org.zwobble.precisely.Matchers.equalTo; +import static org.zwobble.precisely.Matchers.isSequence; + +public class PointTests { + @Test + public void line() { + var line = new Line<>( + new Point2D(10, 25), + new Point2D(42, 47) + ); + assertEquals(line.start().x(), 10); + assertEquals(line.end().y(), 47); + } + + @Test + public void matchers() { + var lineDrawing = new LineDrawing<>(List.of( + new Line<>(new Point2D(10, 25), new Point2D(42, 47)) + )); + + assertThat(lineDrawing, isLineDrawing() + .withLines(isSequence( + isLine() + .withStart(isPoint2D().withX(equalTo(10)).withY(equalTo(25))) + .withEnd(isPoint2D().withX(equalTo(42)).withY(equalTo(47))) + )) + ); + } +} |
