|
|
@ -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); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|