|
|
@ -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); |
|
|
|
} |
|
|
|
} |