|
|
@ -0,0 +1,36 @@ |
|
|
|
package pacmanTests; |
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import pacmanGame.*; |
|
|
|
|
|
|
|
|
|
|
|
class Vector2Test { |
|
|
|
|
|
|
|
@Test |
|
|
|
void Vector2_sameValues_areEqual() { |
|
|
|
// arrange |
|
|
|
Vector2 a = new Vector2(2, 2); |
|
|
|
Vector2 b = new Vector2(2, 2); |
|
|
|
boolean expected = true; |
|
|
|
// act |
|
|
|
boolean result = a.equals(b); |
|
|
|
// assert |
|
|
|
assertThat(result).isEqualTo(expected); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void Vector2_differentValues_areNotEqual() { |
|
|
|
// arrange |
|
|
|
Vector2 a = new Vector2(2, 2); |
|
|
|
Vector2 b = new Vector2(2, 5); |
|
|
|
boolean expected = false; |
|
|
|
// act |
|
|
|
boolean result = a.equals(b); |
|
|
|
// assert |
|
|
|
assertThat(result).isEqualTo(expected); |
|
|
|
} |
|
|
|
} |