From 89fd6741babb1adfe98125bea4ee6142102a3572 Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Wed, 8 Feb 2023 21:57:11 +0100 Subject: [PATCH] Unittest Pong --- src/test_/java/CollisionCheckerTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test_/java/CollisionCheckerTest.java b/src/test_/java/CollisionCheckerTest.java index 7e3e1c8..10da0f9 100644 --- a/src/test_/java/CollisionCheckerTest.java +++ b/src/test_/java/CollisionCheckerTest.java @@ -2,6 +2,7 @@ import PingPong.CollisionChecker; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -35,4 +36,16 @@ public class CollisionCheckerTest { //assert assertTrue(result); } + @Test + void WhenBallYCoordinateIsMoreThanZeroAndLessThanMaxHeight_didTouchTopOrBottomEdge_ReturnsFalse() { + // arrange + Integer ballYCoordinate = 75; + Integer maxHeight = 123; + + // act + Boolean result = collisionChecker.didTouchTopOrBottomEdge(ballYCoordinate, maxHeight); + + //assert + assertFalse(result); + } }