Browse Source

Unittest Pong

main
fdai4616 2 years ago
parent
commit
ee3b0802f2
  1. 12
      src/test_/java/CollisionCheckerTest.java

12
src/test_/java/CollisionCheckerTest.java

@ -62,4 +62,16 @@ public class CollisionCheckerTest {
//assert //assert
assertTrue(result); 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);
}
} }
Loading…
Cancel
Save