From 1f45383f8cb3fa01eb5865454e81af4f8f071926 Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:28:02 +0400 Subject: [PATCH] update tests to cater for tolerance --- .../com/github/creme332/tests/model/ShapeWrapperTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/github/creme332/tests/model/ShapeWrapperTest.java b/src/test/java/com/github/creme332/tests/model/ShapeWrapperTest.java index a72ea87..3cef9d8 100644 --- a/src/test/java/com/github/creme332/tests/model/ShapeWrapperTest.java +++ b/src/test/java/com/github/creme332/tests/model/ShapeWrapperTest.java @@ -108,8 +108,11 @@ public void testIsPointOnShape() { // Inside the shape assertTrue(shapeWrapper.isPointOnShape(new Point2D.Double(0.5, 0.5))); - // Outside the shape - assertFalse(shapeWrapper.isPointOnShape(new Point2D.Double(1.5, 1.5))); + // Outside the shape but within tolerance region + assertTrue(shapeWrapper.isPointOnShape(new Point2D.Double(1.5, 1.5))); + + // Outside the shape but not within tolerance region + assertFalse(shapeWrapper.isPointOnShape(new Point2D.Double(3, 3))); // On the border of the shape assertTrue(shapeWrapper.isPointOnShape(new Point2D.Double(1, 0)));