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