java.lang.Object
project.pong.view.CollisionDetectorTest
The CollisionDetectorTest class tests the functionality of the CollisionDetector class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetUp()voidTests the detectCollision method when the ball doesn't collide with any racket.voidTests the detectCollision method when the ball collides with a racket.
-
Constructor Details
-
CollisionDetectorTest
public CollisionDetectorTest()
-
-
Method Details
-
setUp
@BeforeEach public void setUp() -
testDetectCollisionWithRacket
@Test public void testDetectCollisionWithRacket()Tests the detectCollision method when the ball collides with a racket. The ball's directionX should be reversed after collision. -
testDetectCollisionWithoutRacket
@Test public void testDetectCollisionWithoutRacket()Tests the detectCollision method when the ball doesn't collide with any racket. The ball's directionX should remain the same without collision.
-