Skip to content

Commit

Permalink
Fix SpaceGameAreaTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Foref committed Oct 19, 2023
1 parent 2a6a330 commit 9226d38
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,13 @@ public void testCalculateDistanceWithNonZeroDistance() {
}
@Test
public void testIsPositionOccupied() {

SpaceGameArea spaceGameArea = mock(SpaceGameArea.class);

// Define an unoccupied position
GridPoint2 unoccupiedPosition = new Vector2(1f, 1f);


Vector2 unoccupiedPosition = new Vector2(1f, 1f);
when(spaceGameArea.isPositionOccupied(unoccupiedPosition)).thenReturn(false);
assertFalse(spaceGameArea.isPositionOccupied(unoccupiedPosition));

// Define an occupied position
GridPoint2 occupiedPosition = new Vector2(2f, 2f);

Vector2 occupiedPosition = new Vector2(2f, 2f);
when(spaceGameArea.isPositionOccupied(occupiedPosition)).thenReturn(true);
assertTrue(spaceGameArea.isPositionOccupied(occupiedPosition));
}
Expand Down

0 comments on commit 9226d38

Please sign in to comment.