|
@ -93,4 +93,16 @@ class Vector2Test { |
|
|
// assert |
|
|
// assert |
|
|
assertThat(isWithin).isEqualTo(expectedWithin); |
|
|
assertThat(isWithin).isEqualTo(expectedWithin); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void Vector2_isWithin_returnsFalseWhenWithin() { |
|
|
|
|
|
// arrange |
|
|
|
|
|
Vector2 area = new Vector2(25, 30); |
|
|
|
|
|
Vector2 point = new Vector2(7, 12); |
|
|
|
|
|
// act |
|
|
|
|
|
boolean isWithin = point.isWithin(area); |
|
|
|
|
|
boolean expectedWithin = true; |
|
|
|
|
|
// assert |
|
|
|
|
|
assertThat(isWithin).isEqualTo(expectedWithin); |
|
|
|
|
|
} |
|
|
} |
|
|
} |