Browse Source

refactoring: fixed suspicious recurring typo

main
fdai7012 11 months ago
parent
commit
23dd94c88d
  1. 16
      src/test/java/pacmanTests/PlayerTest.java

16
src/test/java/pacmanTests/PlayerTest.java

@ -55,12 +55,12 @@ class PlayerTest {
Player player = gameManager.player;
player.position = new Vector2(1,1);
player.direction = new Vector2(-1,0);
Vector2 expectedDdirection = new Vector2(0,1);
Vector2 expectedDirection = new Vector2(0,1);
// act
player.processInput('w');
Vector2 direction = player.direction;
// assert
assertThat(direction).isEqualTo(expectedDdirection);
assertThat(direction).isEqualTo(expectedDirection);
}
@Test
@ -78,12 +78,12 @@ class PlayerTest {
Player player = gameManager.player;
player.position = new Vector2(1,1);
player.direction = new Vector2(-1,0);
Vector2 expectedDdirection = new Vector2(0,-1);
Vector2 expectedDirection = new Vector2(0,-1);
// act
player.processInput('s');
Vector2 direction = player.direction;
// assert
assertThat(direction).isEqualTo(expectedDdirection);
assertThat(direction).isEqualTo(expectedDirection);
}
@Test
@ -101,12 +101,12 @@ class PlayerTest {
Player player = gameManager.player;
player.position = new Vector2(1,1);
player.direction = new Vector2(-1,0);
Vector2 expectedDdirection = new Vector2(-1,0);
Vector2 expectedDirection = new Vector2(-1,0);
// act
player.processInput('a');
Vector2 direction = player.direction;
// assert
assertThat(direction).isEqualTo(expectedDdirection);
assertThat(direction).isEqualTo(expectedDirection);
}
@Test
@ -124,12 +124,12 @@ class PlayerTest {
Player player = gameManager.player;
player.position = new Vector2(1,1);
player.direction = new Vector2(-1,0);
Vector2 expectedDdirection = new Vector2(1,0);
Vector2 expectedDirection = new Vector2(1,0);
// act
player.processInput('d');
Vector2 direction = player.direction;
// assert
assertThat(direction).isEqualTo(expectedDdirection);
assertThat(direction).isEqualTo(expectedDirection);
}

Loading…
Cancel
Save