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

Loading…
Cancel
Save