From 4e10ef914d8db1f1fe38611a6ec592494e490d61 Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Wed, 8 Feb 2023 22:00:18 +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 0fdf316..9ba64c5 100644 --- a/src/test_/java/CollisionCheckerTest.java +++ b/src/test_/java/CollisionCheckerTest.java @@ -96,4 +96,16 @@ public class CollisionCheckerTest { //assert assertFalse(result); } + @Test + void WhenBallXCoordinateIsMoreOrEqualToMaxWidth_didTouchRightEdge_ReturnsTrue() { + // arrange + Integer ballXCoordinate = 124; + Integer maxWidth = 123; + + // act + Boolean result = collisionChecker.didTouchRightEdge(ballXCoordinate, maxWidth); + + //assert + assertTrue(result); + } }