From ee3b0802f266b5cb5391018c972c97bd3445d21b Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Wed, 8 Feb 2023 21:58:28 +0100 Subject: [PATCH] Unittest Pong --- src/test_/java/CollisionCheckerTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test_/java/CollisionCheckerTest.java b/src/test_/java/CollisionCheckerTest.java index 277d0e1..788700b 100644 --- a/src/test_/java/CollisionCheckerTest.java +++ b/src/test_/java/CollisionCheckerTest.java @@ -62,4 +62,16 @@ public class CollisionCheckerTest { //assert assertTrue(result); } + @Test + void WhenBallRectangleDoesNotIntersectsWithPaddleRectangle_didTouchPaddle_ReturnsFalse() { + // arrange + Rectangle ballRectangle = new Rectangle(1,1,1,1); + Rectangle paddleRectangle = new Rectangle(15,15,1,1); + + //act + Boolean result = collisionChecker.didTouchPaddle(ballRectangle, paddleRectangle); + + //assert + assertFalse(result); + } }