Browse Source

Unittest Pong

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

12
src/test_/java/CollisionCheckerTest.java

@ -20,6 +20,18 @@ public class CollisionCheckerTest {
// act // act
Boolean result = collisionChecker.didTouchTopOrBottomEdge(ballYCoordinate, maxHeight); Boolean result = collisionChecker.didTouchTopOrBottomEdge(ballYCoordinate, maxHeight);
//assert
assertTrue(result);
}
@Test
void WhenBallYCoordinateIsMoreOrEqualToMaxHeight_didTouchTopOrBottomEdge_ReturnsTrue() {
// arrange
Integer ballYCoordinate = 124;
Integer maxHeight = 123;
// act
Boolean result = collisionChecker.didTouchTopOrBottomEdge(ballYCoordinate, maxHeight);
//assert //assert
assertTrue(result); assertTrue(result);
} }

Loading…
Cancel
Save